Analysis: Update some tests for opaque pointers

StackSafetyAnalysis/lifetime.ll had one bitcast removed that may have
mattered. The concluded lifetime is longer based on the underlying
alloca, instead of the bitcasted pointer so left that as a pointless
cast.

local.ll memintrin.ll needed some manual fixes
This commit is contained in:
Matt Arsenault 2022-12-02 17:25:57 -05:00
parent 81c163e3e1
commit 7cf5581712
42 changed files with 1143 additions and 1274 deletions

View File

@ -1,6 +1,6 @@
; RUN: opt < %s -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s ; RUN: opt < %s -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s
define i32 @test1(i32 %i, i32* %a) { define i32 @test1(i32 %i, ptr %a) {
; CHECK: Printing analysis {{.*}} for function 'test1' ; CHECK: Printing analysis {{.*}} for function 'test1'
entry: entry:
br label %body br label %body
@ -9,8 +9,8 @@ entry:
body: body:
%iv = phi i32 [ 0, %entry ], [ %next, %body ] %iv = phi i32 [ 0, %entry ], [ %next, %body ]
%base = phi i32 [ 0, %entry ], [ %sum, %body ] %base = phi i32 [ 0, %entry ], [ %sum, %body ]
%arrayidx = getelementptr inbounds i32, i32* %a, i32 %iv %arrayidx = getelementptr inbounds i32, ptr %a, i32 %iv
%0 = load i32, i32* %arrayidx %0 = load i32, ptr %arrayidx
%sum = add nsw i32 %0, %base %sum = add nsw i32 %0, %base
%next = add i32 %iv, 1 %next = add i32 %iv, 1
%exitcond = icmp eq i32 %next, %i %exitcond = icmp eq i32 %next, %i
@ -197,7 +197,7 @@ exit:
!3 = !{!"branch_weights", i32 100, i32 1} !3 = !{!"branch_weights", i32 100, i32 1}
define i32 @test_cold_call_sites(i32* %a) { define i32 @test_cold_call_sites(ptr %a) {
; Test that edges to blocks post-dominated by cold call sites ; Test that edges to blocks post-dominated by cold call sites
; are marked as not expected to be taken. ; are marked as not expected to be taken.
; TODO(dnovillo) The calls to regular_function should not be merged, but ; TODO(dnovillo) The calls to regular_function should not be merged, but
@ -209,8 +209,8 @@ define i32 @test_cold_call_sites(i32* %a) {
; CHECK: edge entry -> else probability is 0x78787f1d / 0x80000000 = 94.12% [HOT edge] ; CHECK: edge entry -> else probability is 0x78787f1d / 0x80000000 = 94.12% [HOT edge]
entry: entry:
%gep1 = getelementptr i32, i32* %a, i32 1 %gep1 = getelementptr i32, ptr %a, i32 1
%val1 = load i32, i32* %gep1 %val1 = load i32, ptr %gep1
%cond1 = icmp ugt i32 %val1, 1 %cond1 = icmp ugt i32 %val1, 1
br i1 %cond1, label %then, label %else br i1 %cond1, label %then, label %else
@ -220,8 +220,8 @@ then:
br label %exit br label %exit
else: else:
%gep2 = getelementptr i32, i32* %a, i32 2 %gep2 = getelementptr i32, ptr %a, i32 2
%val2 = load i32, i32* %gep2 %val2 = load i32, ptr %gep2
%val3 = call i32 @regular_function(i32 %val2) %val3 = call i32 @regular_function(i32 %val2)
br label %exit br label %exit
@ -231,7 +231,7 @@ exit:
} }
; CHECK-LABEL: test_invoke_code_callsite1 ; CHECK-LABEL: test_invoke_code_callsite1
define i32 @test_invoke_code_callsite1(i1 %c) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { define i32 @test_invoke_code_callsite1(i1 %c) personality ptr @__gxx_personality_v0 {
entry: entry:
br i1 %c, label %if.then, label %if.end br i1 %c, label %if.then, label %if.end
; Edge "entry->if.end" should have higher probability based on the cold call ; Edge "entry->if.end" should have higher probability based on the cold call
@ -251,7 +251,7 @@ invoke.cont:
br label %if.end br label %if.end
lpad: lpad:
%ll = landingpad { i8*, i32 } %ll = landingpad { ptr, i32 }
cleanup cleanup
br label %if.end br label %if.end
@ -260,7 +260,7 @@ if.end:
} }
; CHECK-LABEL: test_invoke_code_callsite2 ; CHECK-LABEL: test_invoke_code_callsite2
define i32 @test_invoke_code_callsite2(i1 %c) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { define i32 @test_invoke_code_callsite2(i1 %c) personality ptr @__gxx_personality_v0 {
entry: entry:
br i1 %c, label %if.then, label %if.end br i1 %c, label %if.then, label %if.end
@ -277,7 +277,7 @@ invoke.cont:
br label %if.end br label %if.end
lpad: lpad:
%ll = landingpad { i8*, i32 } %ll = landingpad { ptr, i32 }
cleanup cleanup
call void @ColdFunc() #0 call void @ColdFunc() #0
br label %if.end br label %if.end
@ -287,7 +287,7 @@ if.end:
} }
; CHECK-LABEL: test_invoke_code_callsite3 ; CHECK-LABEL: test_invoke_code_callsite3
define i32 @test_invoke_code_callsite3(i1 %c) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { define i32 @test_invoke_code_callsite3(i1 %c) personality ptr @__gxx_personality_v0 {
entry: entry:
br i1 %c, label %if.then, label %if.end br i1 %c, label %if.then, label %if.end
; CHECK: edge entry -> if.then probability is 0x078780e3 / 0x80000000 = 5.88% ; CHECK: edge entry -> if.then probability is 0x078780e3 / 0x80000000 = 5.88%
@ -306,7 +306,7 @@ invoke.cont:
br label %if.end br label %if.end
lpad: lpad:
%ll = landingpad { i8*, i32 } %ll = landingpad { ptr, i32 }
cleanup cleanup
call void @ColdFunc() #0 call void @ColdFunc() #0
br label %if.end br label %if.end
@ -316,7 +316,7 @@ if.end:
} }
; CHECK-LABEL: test_invoke_code_profiled ; CHECK-LABEL: test_invoke_code_profiled
define void @test_invoke_code_profiled(i1 %c) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { define void @test_invoke_code_profiled(i1 %c) personality ptr @__gxx_personality_v0 {
entry: entry:
; CHECK: edge entry -> invoke.to0 probability is 0x7ffff800 / 0x80000000 = 100.00% [HOT edge] ; CHECK: edge entry -> invoke.to0 probability is 0x7ffff800 / 0x80000000 = 100.00% [HOT edge]
; CHECK: edge entry -> lpad probability is 0x00000800 / 0x80000000 = 0.00% ; CHECK: edge entry -> lpad probability is 0x00000800 / 0x80000000 = 0.00%
@ -339,7 +339,7 @@ invoke.to2:
ret void ret void
lpad: lpad:
%ll = landingpad { i8*, i32 } %ll = landingpad { ptr, i32 }
cleanup cleanup
ret void ret void
} }

View File

@ -1,6 +1,6 @@
; RUN: opt < %s -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s ; RUN: opt < %s -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s
declare i32* @"personality_function"() #1 declare ptr @"personality_function"() #1
declare void @foo(i32) declare void @foo(i32)
declare void @bar() declare void @bar()
declare void @llvm.experimental.deoptimize.isVoid(...) declare void @llvm.experimental.deoptimize.isVoid(...)
@ -8,7 +8,7 @@ declare void @cold() cold
; Even though the likeliness of 'invoke' to throw an exception is assessed as low ; Even though the likeliness of 'invoke' to throw an exception is assessed as low
; all other paths are even less likely. Check that hot paths leads to excepion handler. ; all other paths are even less likely. Check that hot paths leads to excepion handler.
define void @test1(i32 %0) personality i32* ()* @"personality_function" !prof !1 { define void @test1(i32 %0) personality ptr @"personality_function" !prof !1 {
;CHECK: edge entry -> unreached probability is 0x00000001 / 0x80000000 = 0.00% ;CHECK: edge entry -> unreached probability is 0x00000001 / 0x80000000 = 0.00%
;CHECK: edge entry -> invoke probability is 0x7fffffff / 0x80000000 = 100.00% [HOT edge] ;CHECK: edge entry -> invoke probability is 0x7fffffff / 0x80000000 = 100.00% [HOT edge]
;CHECK: edge invoke -> invoke.cont.unreached probability is 0x00000000 / 0x80000000 = 0.00% ;CHECK: edge invoke -> invoke.cont.unreached probability is 0x00000000 / 0x80000000 = 0.00%
@ -28,9 +28,9 @@ unreached:
unreachable unreachable
land.pad: land.pad:
%v20 = landingpad { i8*, i32 } %v20 = landingpad { ptr, i32 }
cleanup cleanup
%v21 = load i8 addrspace(1)*, i8 addrspace(1)* addrspace(256)* inttoptr (i64 8 to i8 addrspace(1)* addrspace(256)*), align 8 %v21 = load ptr addrspace(1), ptr addrspace(256) inttoptr (i64 8 to ptr addrspace(256)), align 8
br label %exit br label %exit
exit: exit:
@ -38,7 +38,7 @@ exit:
ret void ret void
} }
define void @test2(i32 %0) personality i32* ()* @"personality_function" { define void @test2(i32 %0) personality ptr @"personality_function" {
;CHECK: edge entry -> unreached probability is 0x00000000 / 0x80000000 = 0.00% ;CHECK: edge entry -> unreached probability is 0x00000000 / 0x80000000 = 0.00%
;CHECK: edge entry -> invoke probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] ;CHECK: edge entry -> invoke probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
;CHECK: edge invoke -> invoke.cont.cold probability is 0x7fff8000 / 0x80000000 = 100.00% [HOT edge] ;CHECK: edge invoke -> invoke.cont.cold probability is 0x7fff8000 / 0x80000000 = 100.00% [HOT edge]
@ -58,9 +58,9 @@ unreached:
unreachable unreachable
land.pad: land.pad:
%v20 = landingpad { i8*, i32 } %v20 = landingpad { ptr, i32 }
cleanup cleanup
%v21 = load i8 addrspace(1)*, i8 addrspace(1)* addrspace(256)* inttoptr (i64 8 to i8 addrspace(1)* addrspace(256)*), align 8 %v21 = load ptr addrspace(1), ptr addrspace(256) inttoptr (i64 8 to ptr addrspace(256)), align 8
br label %exit br label %exit
exit: exit:
@ -68,7 +68,7 @@ exit:
ret void ret void
} }
define void @test3(i32 %0) personality i32* ()* @"personality_function" { define void @test3(i32 %0) personality ptr @"personality_function" {
;CHECK: edge entry -> unreached probability is 0x00000000 / 0x80000000 = 0.00% ;CHECK: edge entry -> unreached probability is 0x00000000 / 0x80000000 = 0.00%
;CHECK: edge entry -> invoke probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] ;CHECK: edge entry -> invoke probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
;CHECK: edge invoke -> invoke.cont.cold probability is 0x7fff8000 / 0x80000000 = 100.00% [HOT edge] ;CHECK: edge invoke -> invoke.cont.cold probability is 0x7fff8000 / 0x80000000 = 100.00% [HOT edge]
@ -87,9 +87,9 @@ unreached:
unreachable unreachable
land.pad: land.pad:
%v20 = landingpad { i8*, i32 } %v20 = landingpad { ptr, i32 }
cleanup cleanup
%v21 = load i8 addrspace(1)*, i8 addrspace(1)* addrspace(256)* inttoptr (i64 8 to i8 addrspace(1)* addrspace(256)*), align 8 %v21 = load ptr addrspace(1), ptr addrspace(256) inttoptr (i64 8 to ptr addrspace(256)), align 8
call void @cold() call void @cold()
br label %exit br label %exit

View File

@ -1,21 +1,21 @@
; RUN: opt < %s -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s ; RUN: opt < %s -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s
declare i32 @strcmp(i8*, i8*) declare i32 @strcmp(ptr, ptr)
declare i32 @strncmp(i8*, i8*, i32) declare i32 @strncmp(ptr, ptr, i32)
declare i32 @strcasecmp(i8*, i8*) declare i32 @strcasecmp(ptr, ptr)
declare i32 @strncasecmp(i8*, i8*, i32) declare i32 @strncasecmp(ptr, ptr, i32)
declare i32 @memcmp(i8*, i8*) declare i32 @memcmp(ptr, ptr)
declare i32 @bcmp(i8*, i8*) declare i32 @bcmp(ptr, ptr)
declare i32 @nonstrcmp(i8*, i8*) declare i32 @nonstrcmp(ptr, ptr)
; Check that the result of strcmp is considered more likely to be nonzero than ; Check that the result of strcmp is considered more likely to be nonzero than
; zero, and equally likely to be (nonzero) positive or negative. ; zero, and equally likely to be (nonzero) positive or negative.
define i32 @test_strcmp_eq(i8* %p, i8* %q) { define i32 @test_strcmp_eq(ptr %p, ptr %q) {
; CHECK: Printing analysis {{.*}} for function 'test_strcmp_eq' ; CHECK: Printing analysis {{.*}} for function 'test_strcmp_eq'
entry: entry:
%val = call i32 @strcmp(i8* %p, i8* %q) %val = call i32 @strcmp(ptr %p, ptr %q)
%cond = icmp eq i32 %val, 0 %cond = icmp eq i32 %val, 0
br i1 %cond, label %then, label %else br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x30000000 / 0x80000000 = 37.50% ; CHECK: edge entry -> then probability is 0x30000000 / 0x80000000 = 37.50%
@ -34,10 +34,10 @@ exit:
ret i32 %result ret i32 %result
} }
define i32 @test_strcmp_eq5(i8* %p, i8* %q) { define i32 @test_strcmp_eq5(ptr %p, ptr %q) {
; CHECK: Printing analysis {{.*}} for function 'test_strcmp_eq5' ; CHECK: Printing analysis {{.*}} for function 'test_strcmp_eq5'
entry: entry:
%val = call i32 @strcmp(i8* %p, i8* %q) %val = call i32 @strcmp(ptr %p, ptr %q)
%cond = icmp eq i32 %val, 5 %cond = icmp eq i32 %val, 5
br i1 %cond, label %then, label %else br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x30000000 / 0x80000000 = 37.50% ; CHECK: edge entry -> then probability is 0x30000000 / 0x80000000 = 37.50%
@ -56,10 +56,10 @@ exit:
ret i32 %result ret i32 %result
} }
define i32 @test_strcmp_ne(i8* %p, i8* %q) { define i32 @test_strcmp_ne(ptr %p, ptr %q) {
; CHECK: Printing analysis {{.*}} for function 'test_strcmp_ne' ; CHECK: Printing analysis {{.*}} for function 'test_strcmp_ne'
entry: entry:
%val = call i32 @strcmp(i8* %p, i8* %q) %val = call i32 @strcmp(ptr %p, ptr %q)
%cond = icmp ne i32 %val, 0 %cond = icmp ne i32 %val, 0
br i1 %cond, label %then, label %else br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x50000000 / 0x80000000 = 62.50% ; CHECK: edge entry -> then probability is 0x50000000 / 0x80000000 = 62.50%
@ -78,10 +78,10 @@ exit:
ret i32 %result ret i32 %result
} }
define i32 @test_strcmp_sgt(i8* %p, i8* %q) { define i32 @test_strcmp_sgt(ptr %p, ptr %q) {
; CHECK: Printing analysis {{.*}} for function 'test_strcmp_sgt' ; CHECK: Printing analysis {{.*}} for function 'test_strcmp_sgt'
entry: entry:
%val = call i32 @strcmp(i8* %p, i8* %q) %val = call i32 @strcmp(ptr %p, ptr %q)
%cond = icmp sgt i32 %val, 0 %cond = icmp sgt i32 %val, 0
br i1 %cond, label %then, label %else br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x40000000 / 0x80000000 = 50.00% ; CHECK: edge entry -> then probability is 0x40000000 / 0x80000000 = 50.00%
@ -100,10 +100,10 @@ exit:
ret i32 %result ret i32 %result
} }
define i32 @test_strcmp_slt(i8* %p, i8* %q) { define i32 @test_strcmp_slt(ptr %p, ptr %q) {
; CHECK: Printing analysis {{.*}} for function 'test_strcmp_slt' ; CHECK: Printing analysis {{.*}} for function 'test_strcmp_slt'
entry: entry:
%val = call i32 @strcmp(i8* %p, i8* %q) %val = call i32 @strcmp(ptr %p, ptr %q)
%cond = icmp slt i32 %val, 0 %cond = icmp slt i32 %val, 0
br i1 %cond, label %then, label %else br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x40000000 / 0x80000000 = 50.00% ; CHECK: edge entry -> then probability is 0x40000000 / 0x80000000 = 50.00%
@ -125,10 +125,10 @@ exit:
; Similarly check other library functions that have the same behaviour ; Similarly check other library functions that have the same behaviour
define i32 @test_strncmp_sgt(i8* %p, i8* %q) { define i32 @test_strncmp_sgt(ptr %p, ptr %q) {
; CHECK: Printing analysis {{.*}} for function 'test_strncmp_sgt' ; CHECK: Printing analysis {{.*}} for function 'test_strncmp_sgt'
entry: entry:
%val = call i32 @strncmp(i8* %p, i8* %q, i32 4) %val = call i32 @strncmp(ptr %p, ptr %q, i32 4)
%cond = icmp sgt i32 %val, 0 %cond = icmp sgt i32 %val, 0
br i1 %cond, label %then, label %else br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x40000000 / 0x80000000 = 50.00% ; CHECK: edge entry -> then probability is 0x40000000 / 0x80000000 = 50.00%
@ -147,10 +147,10 @@ exit:
ret i32 %result ret i32 %result
} }
define i32 @test_strcasecmp_sgt(i8* %p, i8* %q) { define i32 @test_strcasecmp_sgt(ptr %p, ptr %q) {
; CHECK: Printing analysis {{.*}} for function 'test_strcasecmp_sgt' ; CHECK: Printing analysis {{.*}} for function 'test_strcasecmp_sgt'
entry: entry:
%val = call i32 @strcasecmp(i8* %p, i8* %q) %val = call i32 @strcasecmp(ptr %p, ptr %q)
%cond = icmp sgt i32 %val, 0 %cond = icmp sgt i32 %val, 0
br i1 %cond, label %then, label %else br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x40000000 / 0x80000000 = 50.00% ; CHECK: edge entry -> then probability is 0x40000000 / 0x80000000 = 50.00%
@ -169,10 +169,10 @@ exit:
ret i32 %result ret i32 %result
} }
define i32 @test_strncasecmp_sgt(i8* %p, i8* %q) { define i32 @test_strncasecmp_sgt(ptr %p, ptr %q) {
; CHECK: Printing analysis {{.*}} for function 'test_strncasecmp_sgt' ; CHECK: Printing analysis {{.*}} for function 'test_strncasecmp_sgt'
entry: entry:
%val = call i32 @strncasecmp(i8* %p, i8* %q, i32 4) %val = call i32 @strncasecmp(ptr %p, ptr %q, i32 4)
%cond = icmp sgt i32 %val, 0 %cond = icmp sgt i32 %val, 0
br i1 %cond, label %then, label %else br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x40000000 / 0x80000000 = 50.00% ; CHECK: edge entry -> then probability is 0x40000000 / 0x80000000 = 50.00%
@ -191,10 +191,10 @@ exit:
ret i32 %result ret i32 %result
} }
define i32 @test_memcmp_sgt(i8* %p, i8* %q) { define i32 @test_memcmp_sgt(ptr %p, ptr %q) {
; CHECK: Printing analysis {{.*}} for function 'test_memcmp_sgt' ; CHECK: Printing analysis {{.*}} for function 'test_memcmp_sgt'
entry: entry:
%val = call i32 @memcmp(i8* %p, i8* %q) %val = call i32 @memcmp(ptr %p, ptr %q)
%cond = icmp sgt i32 %val, 0 %cond = icmp sgt i32 %val, 0
br i1 %cond, label %then, label %else br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x40000000 / 0x80000000 = 50.00% ; CHECK: edge entry -> then probability is 0x40000000 / 0x80000000 = 50.00%
@ -218,10 +218,10 @@ exit:
; heuristic is applied, i.e. positive more likely than negative, nonzero more ; heuristic is applied, i.e. positive more likely than negative, nonzero more
; likely than zero. ; likely than zero.
define i32 @test_nonstrcmp_eq(i8* %p, i8* %q) { define i32 @test_nonstrcmp_eq(ptr %p, ptr %q) {
; CHECK: Printing analysis {{.*}} for function 'test_nonstrcmp_eq' ; CHECK: Printing analysis {{.*}} for function 'test_nonstrcmp_eq'
entry: entry:
%val = call i32 @nonstrcmp(i8* %p, i8* %q) %val = call i32 @nonstrcmp(ptr %p, ptr %q)
%cond = icmp eq i32 %val, 0 %cond = icmp eq i32 %val, 0
br i1 %cond, label %then, label %else br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x30000000 / 0x80000000 = 37.50% ; CHECK: edge entry -> then probability is 0x30000000 / 0x80000000 = 37.50%
@ -240,10 +240,10 @@ exit:
ret i32 %result ret i32 %result
} }
define i32 @test_nonstrcmp_ne(i8* %p, i8* %q) { define i32 @test_nonstrcmp_ne(ptr %p, ptr %q) {
; CHECK: Printing analysis {{.*}} for function 'test_nonstrcmp_ne' ; CHECK: Printing analysis {{.*}} for function 'test_nonstrcmp_ne'
entry: entry:
%val = call i32 @nonstrcmp(i8* %p, i8* %q) %val = call i32 @nonstrcmp(ptr %p, ptr %q)
%cond = icmp ne i32 %val, 0 %cond = icmp ne i32 %val, 0
br i1 %cond, label %then, label %else br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x50000000 / 0x80000000 = 62.50% ; CHECK: edge entry -> then probability is 0x50000000 / 0x80000000 = 62.50%
@ -262,10 +262,10 @@ exit:
ret i32 %result ret i32 %result
} }
define i32 @test_nonstrcmp_sgt(i8* %p, i8* %q) { define i32 @test_nonstrcmp_sgt(ptr %p, ptr %q) {
; CHECK: Printing analysis {{.*}} for function 'test_nonstrcmp_sgt' ; CHECK: Printing analysis {{.*}} for function 'test_nonstrcmp_sgt'
entry: entry:
%val = call i32 @nonstrcmp(i8* %p, i8* %q) %val = call i32 @nonstrcmp(ptr %p, ptr %q)
%cond = icmp sgt i32 %val, 0 %cond = icmp sgt i32 %val, 0
br i1 %cond, label %then, label %else br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x50000000 / 0x80000000 = 62.50% ; CHECK: edge entry -> then probability is 0x50000000 / 0x80000000 = 62.50%
@ -285,10 +285,10 @@ exit:
} }
define i32 @test_bcmp_eq(i8* %p, i8* %q) { define i32 @test_bcmp_eq(ptr %p, ptr %q) {
; CHECK: Printing analysis {{.*}} for function 'test_bcmp_eq' ; CHECK: Printing analysis {{.*}} for function 'test_bcmp_eq'
entry: entry:
%val = call i32 @bcmp(i8* %p, i8* %q) %val = call i32 @bcmp(ptr %p, ptr %q)
%cond = icmp eq i32 %val, 0 %cond = icmp eq i32 %val, 0
br i1 %cond, label %then, label %else br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x30000000 / 0x80000000 = 37.50% ; CHECK: edge entry -> then probability is 0x30000000 / 0x80000000 = 37.50%
@ -307,10 +307,10 @@ exit:
ret i32 %result ret i32 %result
} }
define i32 @test_bcmp_eq5(i8* %p, i8* %q) { define i32 @test_bcmp_eq5(ptr %p, ptr %q) {
; CHECK: Printing analysis {{.*}} for function 'test_bcmp_eq5' ; CHECK: Printing analysis {{.*}} for function 'test_bcmp_eq5'
entry: entry:
%val = call i32 @bcmp(i8* %p, i8* %q) %val = call i32 @bcmp(ptr %p, ptr %q)
%cond = icmp eq i32 %val, 5 %cond = icmp eq i32 %val, 5
br i1 %cond, label %then, label %else br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x30000000 / 0x80000000 = 37.50% ; CHECK: edge entry -> then probability is 0x30000000 / 0x80000000 = 37.50%
@ -331,10 +331,10 @@ exit:
define i32 @test_bcmp_ne(i8* %p, i8* %q) { define i32 @test_bcmp_ne(ptr %p, ptr %q) {
; CHECK: Printing analysis {{.*}} for function 'test_bcmp_ne' ; CHECK: Printing analysis {{.*}} for function 'test_bcmp_ne'
entry: entry:
%val = call i32 @bcmp(i8* %p, i8* %q) %val = call i32 @bcmp(ptr %p, ptr %q)
%cond = icmp ne i32 %val, 0 %cond = icmp ne i32 %val, 0
br i1 %cond, label %then, label %else br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x50000000 / 0x80000000 = 62.50% ; CHECK: edge entry -> then probability is 0x50000000 / 0x80000000 = 62.50%

View File

@ -81,7 +81,7 @@ for.end6:
ret void ret void
} }
define void @test3(i32 %a, i32 %b, i32* %c) { define void @test3(i32 %a, i32 %b, ptr %c) {
entry: entry:
br label %do.body br label %do.body
; CHECK: edge entry -> do.body probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] ; CHECK: edge entry -> do.body probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
@ -89,7 +89,7 @@ entry:
do.body: do.body:
%i.0 = phi i32 [ 0, %entry ], [ %inc4, %if.end ] %i.0 = phi i32 [ 0, %entry ], [ %inc4, %if.end ]
call void @g1() call void @g1()
%0 = load i32, i32* %c, align 4 %0 = load i32, ptr %c, align 4
%cmp = icmp slt i32 %0, 42 %cmp = icmp slt i32 %0, 42
br i1 %cmp, label %do.body1, label %if.end br i1 %cmp, label %do.body1, label %if.end
; CHECK: edge do.body -> do.body1 probability is 0x40000000 / 0x80000000 = 50.00% ; CHECK: edge do.body -> do.body1 probability is 0x40000000 / 0x80000000 = 50.00%
@ -117,7 +117,7 @@ do.end6:
ret void ret void
} }
define void @test4(i32 %a, i32 %b, i32* %c) { define void @test4(i32 %a, i32 %b, ptr %c) {
entry: entry:
br label %do.body br label %do.body
; CHECK: edge entry -> do.body probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] ; CHECK: edge entry -> do.body probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
@ -125,7 +125,7 @@ entry:
do.body: do.body:
%i.0 = phi i32 [ 0, %entry ], [ %inc4, %do.end ] %i.0 = phi i32 [ 0, %entry ], [ %inc4, %do.end ]
call void @g1() call void @g1()
%0 = load i32, i32* %c, align 4 %0 = load i32, ptr %c, align 4
%cmp = icmp slt i32 %0, 42 %cmp = icmp slt i32 %0, 42
br i1 %cmp, label %return, label %do.body1 br i1 %cmp, label %return, label %do.body1
; CHECK: edge do.body -> return probability is 0x04000000 / 0x80000000 = 3.12% ; CHECK: edge do.body -> return probability is 0x04000000 / 0x80000000 = 3.12%
@ -157,7 +157,7 @@ return:
ret void ret void
} }
define void @test5(i32 %a, i32 %b, i32* %c) { define void @test5(i32 %a, i32 %b, ptr %c) {
entry: entry:
br label %do.body br label %do.body
; CHECK: edge entry -> do.body probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] ; CHECK: edge entry -> do.body probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
@ -170,7 +170,7 @@ do.body:
do.body1: do.body1:
%j.0 = phi i32 [ 0, %do.body ], [ %inc, %if.end ] %j.0 = phi i32 [ 0, %do.body ], [ %inc, %if.end ]
%0 = load i32, i32* %c, align 4 %0 = load i32, ptr %c, align 4
%cmp = icmp slt i32 %0, 42 %cmp = icmp slt i32 %0, 42
br i1 %cmp, label %return, label %if.end br i1 %cmp, label %return, label %if.end
; CHECK: edge do.body1 -> return probability is 0x04000000 / 0x80000000 = 3.12% ; CHECK: edge do.body1 -> return probability is 0x04000000 / 0x80000000 = 3.12%
@ -201,7 +201,7 @@ return:
ret void ret void
} }
define void @test6(i32 %a, i32 %b, i32* %c) { define void @test6(i32 %a, i32 %b, ptr %c) {
entry: entry:
br label %do.body br label %do.body
; CHECK: edge entry -> do.body probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] ; CHECK: edge entry -> do.body probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
@ -215,7 +215,7 @@ do.body:
do.body1: do.body1:
%j.0 = phi i32 [ 0, %do.body ], [ %inc, %do.cond ] %j.0 = phi i32 [ 0, %do.body ], [ %inc, %do.cond ]
call void @g2() call void @g2()
%0 = load i32, i32* %c, align 4 %0 = load i32, ptr %c, align 4
%cmp = icmp slt i32 %0, 42 %cmp = icmp slt i32 %0, 42
br i1 %cmp, label %return, label %do.cond br i1 %cmp, label %return, label %do.cond
; CHECK: edge do.body1 -> return probability is 0x04000000 / 0x80000000 = 3.12% ; CHECK: edge do.body1 -> return probability is 0x04000000 / 0x80000000 = 3.12%
@ -245,7 +245,7 @@ return:
ret void ret void
} }
define void @test7(i32 %a, i32 %b, i32* %c) { define void @test7(i32 %a, i32 %b, ptr %c) {
entry: entry:
%cmp10 = icmp sgt i32 %a, 0 %cmp10 = icmp sgt i32 %a, 0
br i1 %cmp10, label %for.body.lr.ph, label %for.end7 br i1 %cmp10, label %for.body.lr.ph, label %for.end7
@ -259,7 +259,7 @@ for.body.lr.ph:
for.body: for.body:
%i.011 = phi i32 [ 0, %for.body.lr.ph ], [ %inc6, %for.inc5 ] %i.011 = phi i32 [ 0, %for.body.lr.ph ], [ %inc6, %for.inc5 ]
%0 = load i32, i32* %c, align 4 %0 = load i32, ptr %c, align 4
%cmp1 = icmp eq i32 %0, %i.011 %cmp1 = icmp eq i32 %0, %i.011
br i1 %cmp1, label %for.inc5, label %if.end br i1 %cmp1, label %for.inc5, label %if.end
; CHECK: edge for.body -> for.inc5 probability is 0x40000000 / 0x80000000 = 50.00% ; CHECK: edge for.body -> for.inc5 probability is 0x40000000 / 0x80000000 = 50.00%
@ -297,7 +297,7 @@ for.end7:
ret void ret void
} }
define void @test8(i32 %a, i32 %b, i32* %c) { define void @test8(i32 %a, i32 %b, ptr %c) {
entry: entry:
%cmp18 = icmp sgt i32 %a, 0 %cmp18 = icmp sgt i32 %a, 0
br i1 %cmp18, label %for.body.lr.ph, label %for.end15 br i1 %cmp18, label %for.body.lr.ph, label %for.end15
@ -306,8 +306,8 @@ entry:
for.body.lr.ph: for.body.lr.ph:
%cmp216 = icmp sgt i32 %b, 0 %cmp216 = icmp sgt i32 %b, 0
%arrayidx5 = getelementptr inbounds i32, i32* %c, i64 1 %arrayidx5 = getelementptr inbounds i32, ptr %c, i64 1
%arrayidx9 = getelementptr inbounds i32, i32* %c, i64 2 %arrayidx9 = getelementptr inbounds i32, ptr %c, i64 2
br label %for.body br label %for.body
; CHECK: edge for.body.lr.ph -> for.body probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] ; CHECK: edge for.body.lr.ph -> for.body probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
@ -320,21 +320,21 @@ for.body:
for.body3: for.body3:
%j.017 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ] %j.017 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]
%0 = load i32, i32* %c, align 4 %0 = load i32, ptr %c, align 4
%cmp4 = icmp eq i32 %0, %j.017 %cmp4 = icmp eq i32 %0, %j.017
br i1 %cmp4, label %for.inc, label %if.end br i1 %cmp4, label %for.inc, label %if.end
; CHECK: edge for.body3 -> for.inc probability is 0x40000000 / 0x80000000 = 50.00% ; CHECK: edge for.body3 -> for.inc probability is 0x40000000 / 0x80000000 = 50.00%
; CHECK: edge for.body3 -> if.end probability is 0x40000000 / 0x80000000 = 50.00% ; CHECK: edge for.body3 -> if.end probability is 0x40000000 / 0x80000000 = 50.00%
if.end: if.end:
%1 = load i32, i32* %arrayidx5, align 4 %1 = load i32, ptr %arrayidx5, align 4
%cmp6 = icmp eq i32 %1, %j.017 %cmp6 = icmp eq i32 %1, %j.017
br i1 %cmp6, label %for.inc, label %if.end8 br i1 %cmp6, label %for.inc, label %if.end8
; CHECK: edge if.end -> for.inc probability is 0x40000000 / 0x80000000 = 50.00% ; CHECK: edge if.end -> for.inc probability is 0x40000000 / 0x80000000 = 50.00%
; CHECK: edge if.end -> if.end8 probability is 0x40000000 / 0x80000000 = 50.00% ; CHECK: edge if.end -> if.end8 probability is 0x40000000 / 0x80000000 = 50.00%
if.end8: if.end8:
%2 = load i32, i32* %arrayidx9, align 4 %2 = load i32, ptr %arrayidx9, align 4
%cmp10 = icmp eq i32 %2, %j.017 %cmp10 = icmp eq i32 %2, %j.017
br i1 %cmp10, label %for.inc, label %if.end12 br i1 %cmp10, label %for.inc, label %if.end12
; CHECK: edge if.end8 -> for.inc probability is 0x40000000 / 0x80000000 = 50.00% ; CHECK: edge if.end8 -> for.inc probability is 0x40000000 / 0x80000000 = 50.00%
@ -403,7 +403,7 @@ end:
; Check that the for.body -> if.then edge is considered unlikely due to making ; Check that the for.body -> if.then edge is considered unlikely due to making
; the if-condition false for the next iteration of the loop. ; the if-condition false for the next iteration of the loop.
define i32 @test10(i32 %n, i32* %p) { define i32 @test10(i32 %n, ptr %p) {
entry: entry:
br label %for.cond br label %for.cond
; CHECK: edge entry -> for.cond probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] ; CHECK: edge entry -> for.cond probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
@ -421,8 +421,8 @@ for.cond.cleanup:
ret i32 %sum.0 ret i32 %sum.0
for.body: for.body:
%arrayidx = getelementptr inbounds i32, i32* %p, i32 %i.0 %arrayidx = getelementptr inbounds i32, ptr %p, i32 %i.0
%0 = load i32, i32* %arrayidx, align 4 %0 = load i32, ptr %arrayidx, align 4
%add = add nsw i32 %sum.0, %0 %add = add nsw i32 %sum.0, %0
%inc = add nsw i32 %count.0, 1 %inc = add nsw i32 %count.0, 1
%cmp1 = icmp sgt i32 %count.0, 6 %cmp1 = icmp sgt i32 %count.0, 6
@ -430,7 +430,7 @@ for.body:
; CHECK: edge for.body -> if.then probability is 0x2aaaa8e4 / 0x80000000 = 33.33% ; CHECK: edge for.body -> if.then probability is 0x2aaaa8e4 / 0x80000000 = 33.33%
; CHECK: edge for.body -> for.inc probability is 0x5555571c / 0x80000000 = 66.67% ; CHECK: edge for.body -> for.inc probability is 0x5555571c / 0x80000000 = 66.67%
if.then: if.then:
store i32 %add, i32* %arrayidx, align 4 store i32 %add, ptr %arrayidx, align 4
br label %for.inc br label %for.inc
; CHECK: edge if.then -> for.inc probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] ; CHECK: edge if.then -> for.inc probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
@ -444,7 +444,7 @@ for.inc:
; Each successor to for.body makes itself not be taken in the next iteration, so ; Each successor to for.body makes itself not be taken in the next iteration, so
; both should be equally likely ; both should be equally likely
define i32 @test11(i32 %n, i32* %p) { define i32 @test11(i32 %n, ptr %p) {
entry: entry:
br label %for.cond br label %for.cond
; CHECK: edge entry -> for.cond probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] ; CHECK: edge entry -> for.cond probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
@ -463,15 +463,15 @@ for.cond.cleanup:
for.body: for.body:
%tobool = icmp eq i32 %flip.0, 0 %tobool = icmp eq i32 %flip.0, 0
%arrayidx1 = getelementptr inbounds i32, i32* %p, i32 %i.0 %arrayidx1 = getelementptr inbounds i32, ptr %p, i32 %i.0
%0 = load i32, i32* %arrayidx1, align 4 %0 = load i32, ptr %arrayidx1, align 4
br i1 %tobool, label %if.else, label %if.then br i1 %tobool, label %if.else, label %if.then
; CHECK: edge for.body -> if.else probability is 0x40000000 / 0x80000000 = 50.00% ; CHECK: edge for.body -> if.else probability is 0x40000000 / 0x80000000 = 50.00%
; CHECK: edge for.body -> if.then probability is 0x40000000 / 0x80000000 = 50.00% ; CHECK: edge for.body -> if.then probability is 0x40000000 / 0x80000000 = 50.00%
if.then: if.then:
%add = add nsw i32 %0, %sum.0 %add = add nsw i32 %0, %sum.0
store i32 %add, i32* %arrayidx1, align 4 store i32 %add, ptr %arrayidx1, align 4
br label %for.inc br label %for.inc
; CHECK: edge if.then -> for.inc probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] ; CHECK: edge if.then -> for.inc probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
@ -510,7 +510,7 @@ invoke.cont:
; CHECK: edge invoke.cont -> exit probability is 0x04000000 / 0x80000000 = 3.12% ; CHECK: edge invoke.cont -> exit probability is 0x04000000 / 0x80000000 = 3.12%
lpad: lpad:
%ll = landingpad { i8*, i32 } %ll = landingpad { ptr, i32 }
cleanup cleanup
br label %exit br label %exit

View File

@ -103,11 +103,11 @@ exit:
ret i32 %b ret i32 %b
} }
@_ZTIi = external global i8* @_ZTIi = external global ptr
; CHECK-LABEL: throwSmallException ; CHECK-LABEL: throwSmallException
; CHECK-NOT: invoke i32 @smallFunction ; CHECK-NOT: invoke i32 @smallFunction
define i32 @throwSmallException(i32 %idx, i32 %limit) #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { define i32 @throwSmallException(i32 %idx, i32 %limit) #0 personality ptr @__gxx_personality_v0 {
entry: entry:
%cmp = icmp sge i32 %idx, %limit %cmp = icmp sge i32 %idx, %limit
br i1 %cmp, label %if.then, label %if.end br i1 %cmp, label %if.then, label %if.end
@ -115,18 +115,18 @@ entry:
; CHECK: edge entry -> if.end probability is 0x7ffff800 / 0x80000000 = 100.00% [HOT edge] ; CHECK: edge entry -> if.end probability is 0x7ffff800 / 0x80000000 = 100.00% [HOT edge]
if.then: ; preds = %entry if.then: ; preds = %entry
%exception = call i8* @__cxa_allocate_exception(i64 1) #0 %exception = call ptr @__cxa_allocate_exception(i64 1) #0
invoke i32 @smallFunction(i32 %idx) invoke i32 @smallFunction(i32 %idx)
to label %invoke.cont unwind label %lpad to label %invoke.cont unwind label %lpad
; CHECK: edge if.then -> invoke.cont probability is 0x40000000 / 0x80000000 = 50.00% ; CHECK: edge if.then -> invoke.cont probability is 0x40000000 / 0x80000000 = 50.00%
; CHECK: edge if.then -> lpad probability is 0x40000000 / 0x80000000 = 50.00% ; CHECK: edge if.then -> lpad probability is 0x40000000 / 0x80000000 = 50.00%
invoke.cont: ; preds = %if.then invoke.cont: ; preds = %if.then
call void @__cxa_throw(i8* %exception, i8* bitcast (i8** @_ZTIi to i8*), i8* null) #1 call void @__cxa_throw(ptr %exception, ptr @_ZTIi, ptr null) #1
unreachable unreachable
lpad: ; preds = %if.then lpad: ; preds = %if.then
%ll = landingpad { i8*, i32 } %ll = landingpad { ptr, i32 }
cleanup cleanup
ret i32 %idx ret i32 %idx
@ -137,13 +137,13 @@ if.end: ; preds = %entry
@a = global i32 4 @a = global i32 4
define i32 @smallFunction(i32 %a) { define i32 @smallFunction(i32 %a) {
entry: entry:
%r = load volatile i32, i32* @a %r = load volatile i32, ptr @a
ret i32 %r ret i32 %r
} }
attributes #0 = { nounwind } attributes #0 = { nounwind }
attributes #1 = { noreturn } attributes #1 = { noreturn }
declare i8* @__cxa_allocate_exception(i64) declare ptr @__cxa_allocate_exception(i64)
declare i32 @__gxx_personality_v0(...) declare i32 @__gxx_personality_v0(...)
declare void @__cxa_throw(i8*, i8*, i8*) declare void @__cxa_throw(ptr, ptr, ptr)

View File

@ -1,19 +1,19 @@
; RUN: opt < %s -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s ; RUN: opt < %s -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s
define i32 @cmp1(i32* readnone %0, i32* readnone %1) { define i32 @cmp1(ptr readnone %0, ptr readnone %1) {
; CHECK: Printing analysis results of BPI for function 'cmp1': ; CHECK: Printing analysis results of BPI for function 'cmp1':
%3 = icmp eq i32* %0, %1 %3 = icmp eq ptr %0, %1
br i1 %3, label %4, label %6 br i1 %3, label %4, label %6
; CHECK: edge -> probability is 0x30000000 / 0x80000000 = 37.50% ; CHECK: edge -> probability is 0x30000000 / 0x80000000 = 37.50%
; CHECK: edge -> probability is 0x50000000 / 0x80000000 = 62.50% ; CHECK: edge -> probability is 0x50000000 / 0x80000000 = 62.50%
4: ; preds = %2 4: ; preds = %2
%5 = tail call i32 bitcast (i32 (...)* @f to i32 ()*)() #2 %5 = tail call i32 @f() #2
br label %8 br label %8
; CHECK: edge -> probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] ; CHECK: edge -> probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
6: ; preds = %2 6: ; preds = %2
%7 = tail call i32 bitcast (i32 (...)* @g to i32 ()*)() #2 %7 = tail call i32 @g() #2
br label %8 br label %8
; CHECK: edge -> probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] ; CHECK: edge -> probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
@ -22,20 +22,20 @@ define i32 @cmp1(i32* readnone %0, i32* readnone %1) {
ret i32 %9 ret i32 %9
} }
define i32 @cmp2(i32* readnone %0, i32* readnone %1) { define i32 @cmp2(ptr readnone %0, ptr readnone %1) {
; CHECK: Printing analysis results of BPI for function 'cmp2': ; CHECK: Printing analysis results of BPI for function 'cmp2':
%3 = icmp eq i32* %0, %1 %3 = icmp eq ptr %0, %1
br i1 %3, label %6, label %4 br i1 %3, label %6, label %4
; CHECK: edge -> probability is 0x30000000 / 0x80000000 = 37.50% ; CHECK: edge -> probability is 0x30000000 / 0x80000000 = 37.50%
; CHECK: edge -> probability is 0x50000000 / 0x80000000 = 62.50% ; CHECK: edge -> probability is 0x50000000 / 0x80000000 = 62.50%
4: ; preds = %2 4: ; preds = %2
%5 = tail call i32 bitcast (i32 (...)* @f to i32 ()*)() #2 %5 = tail call i32 @f() #2
br label %8 br label %8
; CHECK: edge -> probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] ; CHECK: edge -> probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
6: ; preds = %2 6: ; preds = %2
%7 = tail call i32 bitcast (i32 (...)* @g to i32 ()*)() #2 %7 = tail call i32 @g() #2
br label %8 br label %8
; CHECK: edge -> probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] ; CHECK: edge -> probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
@ -45,19 +45,19 @@ define i32 @cmp2(i32* readnone %0, i32* readnone %1) {
} }
; CHECK: Printing analysis results of BPI for function 'cmp3': ; CHECK: Printing analysis results of BPI for function 'cmp3':
define i32 @cmp3(i32* readnone %0) { define i32 @cmp3(ptr readnone %0) {
%2 = icmp eq i32* %0, null %2 = icmp eq ptr %0, null
br i1 %2, label %3, label %5 br i1 %2, label %3, label %5
; CHECK: edge -> probability is 0x30000000 / 0x80000000 = 37.50% ; CHECK: edge -> probability is 0x30000000 / 0x80000000 = 37.50%
; CHECK: edge -> probability is 0x50000000 / 0x80000000 = 62.50% ; CHECK: edge -> probability is 0x50000000 / 0x80000000 = 62.50%
3: ; preds = %1 3: ; preds = %1
%4 = tail call i32 bitcast (i32 (...)* @f to i32 ()*)() #2 %4 = tail call i32 @f() #2
br label %7 br label %7
; CHECK: edge -> probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] ; CHECK: edge -> probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
5: ; preds = %1 5: ; preds = %1
%6 = tail call i32 bitcast (i32 (...)* @g to i32 ()*)() #2 %6 = tail call i32 @g() #2
br label %7 br label %7
; CHECK: edge -> probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] ; CHECK: edge -> probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]

View File

@ -7,7 +7,7 @@
; CHECK: edge while.body -> if.then probability is 0x50000000 / 0x80000000 = 62.50% ; CHECK: edge while.body -> if.then probability is 0x50000000 / 0x80000000 = 62.50%
; CHECK: edge while.body -> if.else probability is 0x30000000 / 0x80000000 = 37.50% ; CHECK: edge while.body -> if.else probability is 0x30000000 / 0x80000000 = 37.50%
define void @foo1(i32 %n, i32* nocapture %b, i32* nocapture %c, i32* nocapture %d, float* nocapture readonly %f0, float* nocapture readonly %f1) { define void @foo1(i32 %n, ptr nocapture %b, ptr nocapture %c, ptr nocapture %d, ptr nocapture readonly %f0, ptr nocapture readonly %f1) {
entry: entry:
%tobool8 = icmp eq i32 %n, 0 %tobool8 = icmp eq i32 %n, 0
br i1 %tobool8, label %while.end, label %while.body.lr.ph br i1 %tobool8, label %while.end, label %while.body.lr.ph
@ -18,36 +18,36 @@ while.body.lr.ph:
while.body: while.body:
%indvars.iv = phi i64 [ %0, %while.body.lr.ph ], [ %indvars.iv.next, %if.end ] %indvars.iv = phi i64 [ %0, %while.body.lr.ph ], [ %indvars.iv.next, %if.end ]
%b.addr.011 = phi i32* [ %b, %while.body.lr.ph ], [ %b.addr.1, %if.end ] %b.addr.011 = phi ptr [ %b, %while.body.lr.ph ], [ %b.addr.1, %if.end ]
%d.addr.010 = phi i32* [ %d, %while.body.lr.ph ], [ %incdec.ptr4, %if.end ] %d.addr.010 = phi ptr [ %d, %while.body.lr.ph ], [ %incdec.ptr4, %if.end ]
%c.addr.09 = phi i32* [ %c, %while.body.lr.ph ], [ %c.addr.1, %if.end ] %c.addr.09 = phi ptr [ %c, %while.body.lr.ph ], [ %c.addr.1, %if.end ]
%indvars.iv.next = add nsw i64 %indvars.iv, -1 %indvars.iv.next = add nsw i64 %indvars.iv, -1
%arrayidx = getelementptr inbounds float, float* %f0, i64 %indvars.iv.next %arrayidx = getelementptr inbounds float, ptr %f0, i64 %indvars.iv.next
%1 = load float, float* %arrayidx, align 4 %1 = load float, ptr %arrayidx, align 4
%arrayidx2 = getelementptr inbounds float, float* %f1, i64 %indvars.iv.next %arrayidx2 = getelementptr inbounds float, ptr %f1, i64 %indvars.iv.next
%2 = load float, float* %arrayidx2, align 4 %2 = load float, ptr %arrayidx2, align 4
%cmp = fcmp une float %1, %2 %cmp = fcmp une float %1, %2
br i1 %cmp, label %if.then, label %if.else br i1 %cmp, label %if.then, label %if.else
if.then: if.then:
%incdec.ptr = getelementptr inbounds i32, i32* %b.addr.011, i64 1 %incdec.ptr = getelementptr inbounds i32, ptr %b.addr.011, i64 1
%3 = load i32, i32* %b.addr.011, align 4 %3 = load i32, ptr %b.addr.011, align 4
%add = add nsw i32 %3, 12 %add = add nsw i32 %3, 12
store i32 %add, i32* %b.addr.011, align 4 store i32 %add, ptr %b.addr.011, align 4
br label %if.end br label %if.end
if.else: if.else:
%incdec.ptr3 = getelementptr inbounds i32, i32* %c.addr.09, i64 1 %incdec.ptr3 = getelementptr inbounds i32, ptr %c.addr.09, i64 1
%4 = load i32, i32* %c.addr.09, align 4 %4 = load i32, ptr %c.addr.09, align 4
%sub = add nsw i32 %4, -13 %sub = add nsw i32 %4, -13
store i32 %sub, i32* %c.addr.09, align 4 store i32 %sub, ptr %c.addr.09, align 4
br label %if.end br label %if.end
if.end: if.end:
%c.addr.1 = phi i32* [ %c.addr.09, %if.then ], [ %incdec.ptr3, %if.else ] %c.addr.1 = phi ptr [ %c.addr.09, %if.then ], [ %incdec.ptr3, %if.else ]
%b.addr.1 = phi i32* [ %incdec.ptr, %if.then ], [ %b.addr.011, %if.else ] %b.addr.1 = phi ptr [ %incdec.ptr, %if.then ], [ %b.addr.011, %if.else ]
%incdec.ptr4 = getelementptr inbounds i32, i32* %d.addr.010, i64 1 %incdec.ptr4 = getelementptr inbounds i32, ptr %d.addr.010, i64 1
store i32 14, i32* %d.addr.010, align 4 store i32 14, ptr %d.addr.010, align 4
%5 = trunc i64 %indvars.iv.next to i32 %5 = trunc i64 %indvars.iv.next to i32
%tobool = icmp eq i32 %5, 0 %tobool = icmp eq i32 %5, 0
br i1 %tobool, label %while.end, label %while.body br i1 %tobool, label %while.end, label %while.body

View File

@ -16,15 +16,15 @@ define i32 @main() #0 {
entry: entry:
%retval = alloca i32, align 4 %retval = alloca i32, align 4
%i = alloca i64, align 8 %i = alloca i64, align 8
store i32 0, i32* %retval store i32 0, ptr %retval
store i64 0, i64* @y, align 8 store i64 0, ptr @y, align 8
store i64 0, i64* @x, align 8 store i64 0, ptr @x, align 8
call void @srand(i32 422304) #3 call void @srand(i32 422304) #3
store i64 0, i64* %i, align 8 store i64 0, ptr %i, align 8
br label %for.cond br label %for.cond
for.cond: ; preds = %for.inc, %entry for.cond: ; preds = %for.inc, %entry
%0 = load i64, i64* %i, align 8 %0 = load i64, ptr %i, align 8
%cmp = icmp ult i64 %0, 13000000000 %cmp = icmp ult i64 %0, 13000000000
br i1 %cmp, label %for.body, label %for.end, !prof !1 br i1 %cmp, label %for.body, label %for.end, !prof !1
@ -37,30 +37,30 @@ for.body: ; preds = %for.cond
br i1 %cmp1, label %if.then, label %if.else, !prof !2 br i1 %cmp1, label %if.then, label %if.else, !prof !2
if.then: ; preds = %for.body if.then: ; preds = %for.body
%1 = load i64, i64* @x, align 8 %1 = load i64, ptr @x, align 8
%inc = add i64 %1, 1 %inc = add i64 %1, 1
store i64 %inc, i64* @x, align 8 store i64 %inc, ptr @x, align 8
br label %if.end br label %if.end
if.else: ; preds = %for.body if.else: ; preds = %for.body
%2 = load i64, i64* @y, align 8 %2 = load i64, ptr @y, align 8
%inc3 = add i64 %2, 1 %inc3 = add i64 %2, 1
store i64 %inc3, i64* @y, align 8 store i64 %inc3, ptr @y, align 8
br label %if.end br label %if.end
if.end: ; preds = %if.else, %if.then if.end: ; preds = %if.else, %if.then
br label %for.inc br label %for.inc
for.inc: ; preds = %if.end for.inc: ; preds = %if.end
%3 = load i64, i64* %i, align 8 %3 = load i64, ptr %i, align 8
%inc4 = add i64 %3, 1 %inc4 = add i64 %3, 1
store i64 %inc4, i64* %i, align 8 store i64 %inc4, ptr %i, align 8
br label %for.cond br label %for.cond
for.end: ; preds = %for.cond for.end: ; preds = %for.cond
%4 = load i64, i64* @x, align 8 %4 = load i64, ptr @x, align 8
%5 = load i64, i64* @y, align 8 %5 = load i64, ptr @y, align 8
%call5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i32 0, i32 0), i64 %4, i64 %5) %call5 = call i32 (ptr, ...) @printf(ptr @.str, i64 %4, i64 %5)
ret i32 0 ret i32 0
} }
@ -70,7 +70,7 @@ declare void @srand(i32) #1
; Function Attrs: nounwind ; Function Attrs: nounwind
declare i32 @rand() #1 declare i32 @rand() #1
declare i32 @printf(i8*, ...) #2 declare i32 @printf(ptr, ...) #2
attributes #0 = { inlinehint nounwind uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #0 = { inlinehint nounwind uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #1 = { nounwind "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }

View File

@ -4,10 +4,10 @@
@B = global i32 0, align 4 @B = global i32 0, align 4
; CHECK-LABEL: eq_opaque_minus_one ; CHECK-LABEL: eq_opaque_minus_one
define void @eq_opaque_minus_one(i32* %base) { define void @eq_opaque_minus_one(ptr %base) {
entry: entry:
%const = bitcast i32 -1 to i32 %const = bitcast i32 -1 to i32
%tmp1 = load i32, i32* @B, align 4 %tmp1 = load i32, ptr @B, align 4
br label %for.body br label %for.body
; CHECK: edge for.body -> if.then probability is 0x30000000 / 0x80000000 = 37.50% ; CHECK: edge for.body -> if.then probability is 0x30000000 / 0x80000000 = 37.50%
@ -15,15 +15,15 @@ entry:
for.body: for.body:
%tmp4 = phi i32 [ %tmp1, %entry ], [ %tmp7, %for.inc ] %tmp4 = phi i32 [ %tmp1, %entry ], [ %tmp7, %for.inc ]
%inc.iv = phi i32 [ 0, %entry ], [ %inc, %for.inc ] %inc.iv = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
%storemerge176.in = getelementptr inbounds i32, i32* %base, i32 %inc.iv %storemerge176.in = getelementptr inbounds i32, ptr %base, i32 %inc.iv
%storemerge176 = load i32, i32* %storemerge176.in, align 4 %storemerge176 = load i32, ptr %storemerge176.in, align 4
store i32 %storemerge176, i32* @A, align 4 store i32 %storemerge176, ptr @A, align 4
%cmp20 = icmp eq i32 %storemerge176, %const %cmp20 = icmp eq i32 %storemerge176, %const
br i1 %cmp20, label %if.then, label %for.inc br i1 %cmp20, label %if.then, label %for.inc
if.then: if.then:
%lnot.ext = zext i1 %cmp20 to i32 %lnot.ext = zext i1 %cmp20 to i32
store i32 %lnot.ext, i32* @B, align 4 store i32 %lnot.ext, ptr @B, align 4
br label %for.inc br label %for.inc
for.inc: for.inc:
@ -37,10 +37,10 @@ exit:
} }
; CHECK-LABEL: ne_opaque_minus_one ; CHECK-LABEL: ne_opaque_minus_one
define void @ne_opaque_minus_one(i32* %base) { define void @ne_opaque_minus_one(ptr %base) {
entry: entry:
%const = bitcast i32 -1 to i32 %const = bitcast i32 -1 to i32
%tmp1 = load i32, i32* @B, align 4 %tmp1 = load i32, ptr @B, align 4
br label %for.body br label %for.body
; CHECK: edge for.body -> if.then probability is 0x50000000 / 0x80000000 = 62.50% ; CHECK: edge for.body -> if.then probability is 0x50000000 / 0x80000000 = 62.50%
@ -48,15 +48,15 @@ entry:
for.body: for.body:
%tmp4 = phi i32 [ %tmp1, %entry ], [ %tmp7, %for.inc ] %tmp4 = phi i32 [ %tmp1, %entry ], [ %tmp7, %for.inc ]
%inc.iv = phi i32 [ 0, %entry ], [ %inc, %for.inc ] %inc.iv = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
%storemerge176.in = getelementptr inbounds i32, i32* %base, i32 %inc.iv %storemerge176.in = getelementptr inbounds i32, ptr %base, i32 %inc.iv
%storemerge176 = load i32, i32* %storemerge176.in, align 4 %storemerge176 = load i32, ptr %storemerge176.in, align 4
store i32 %storemerge176, i32* @A, align 4 store i32 %storemerge176, ptr @A, align 4
%cmp20 = icmp ne i32 %storemerge176, %const %cmp20 = icmp ne i32 %storemerge176, %const
br i1 %cmp20, label %if.then, label %for.inc br i1 %cmp20, label %if.then, label %for.inc
if.then: if.then:
%lnot.ext = zext i1 %cmp20 to i32 %lnot.ext = zext i1 %cmp20 to i32
store i32 %lnot.ext, i32* @B, align 4 store i32 %lnot.ext, ptr @B, align 4
br label %for.inc br label %for.inc
for.inc: for.inc:
@ -70,10 +70,10 @@ exit:
} }
; CHECK-LABEL: sgt_opaque_minus_one ; CHECK-LABEL: sgt_opaque_minus_one
define void @sgt_opaque_minus_one(i32* %base) { define void @sgt_opaque_minus_one(ptr %base) {
entry: entry:
%const = bitcast i32 -1 to i32 %const = bitcast i32 -1 to i32
%tmp1 = load i32, i32* @B, align 4 %tmp1 = load i32, ptr @B, align 4
br label %for.body br label %for.body
; CHECK: edge for.body -> if.then probability is 0x50000000 / 0x80000000 = 62.50% ; CHECK: edge for.body -> if.then probability is 0x50000000 / 0x80000000 = 62.50%
@ -81,15 +81,15 @@ entry:
for.body: for.body:
%tmp4 = phi i32 [ %tmp1, %entry ], [ %tmp7, %for.inc ] %tmp4 = phi i32 [ %tmp1, %entry ], [ %tmp7, %for.inc ]
%inc.iv = phi i32 [ 0, %entry ], [ %inc, %for.inc ] %inc.iv = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
%storemerge176.in = getelementptr inbounds i32, i32* %base, i32 %inc.iv %storemerge176.in = getelementptr inbounds i32, ptr %base, i32 %inc.iv
%storemerge176 = load i32, i32* %storemerge176.in, align 4 %storemerge176 = load i32, ptr %storemerge176.in, align 4
store i32 %storemerge176, i32* @A, align 4 store i32 %storemerge176, ptr @A, align 4
%cmp20 = icmp sgt i32 %storemerge176, %const %cmp20 = icmp sgt i32 %storemerge176, %const
br i1 %cmp20, label %if.then, label %for.inc br i1 %cmp20, label %if.then, label %for.inc
if.then: if.then:
%lnot.ext = zext i1 %cmp20 to i32 %lnot.ext = zext i1 %cmp20 to i32
store i32 %lnot.ext, i32* @B, align 4 store i32 %lnot.ext, ptr @B, align 4
br label %for.inc br label %for.inc
for.inc: for.inc:

View File

@ -12,6 +12,6 @@ entry:
define void @caller() { define void @caller() {
entry: entry:
call void (...) @callee( void (...)* @callee ) call void (...) @callee( ptr @callee )
unreachable unreachable
} }

View File

@ -1,6 +1,6 @@
; RUN: opt < %s -print-callgraph -disable-output 2>&1 | FileCheck %s ; RUN: opt < %s -print-callgraph -disable-output 2>&1 | FileCheck %s
@a = global void ()* @f ; <void ()**> [#uses=0] @a = global ptr @f ; <ptr> [#uses=0]
; CHECK: calls function 'f' ; CHECK: calls function 'f'

View File

@ -5,16 +5,16 @@
; CHECK-NEXT: CS<{{.*}}> calls function 'broker' ; CHECK-NEXT: CS<{{.*}}> calls function 'broker'
; CHECK-NEXT: CS<None> calls function 'callback' ; CHECK-NEXT: CS<None> calls function 'callback'
define void @caller(i32* %arg) { define void @caller(ptr %arg) {
call void @broker(void (i32*)* @callback, i32* %arg) call void @broker(ptr @callback, ptr %arg)
ret void ret void
} }
define void @callback(i32* %arg) { define void @callback(ptr %arg) {
ret void ret void
} }
declare !callback !0 void @broker(void (i32*)*, i32*) declare !callback !0 void @broker(ptr, ptr)
!0 = !{!1} !0 = !{!1}
!1 = !{i64 0, i64 1, i1 false} !1 = !{i64 0, i64 1, i1 false}

View File

@ -4,10 +4,10 @@
; CHECK-NEXT: CS<{{.*}}> calls function '__kmpc_fork_call' ; CHECK-NEXT: CS<{{.*}}> calls function '__kmpc_fork_call'
; CHECK-EMPTY: ; CHECK-EMPTY:
%struct.ident_t = type { i32, i32, i32, i32, i8* } %struct.ident_t = type { i32, i32, i32, i32, ptr }
@0 = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00", align 1 @0 = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00", align 1
@1 = private unnamed_addr global %struct.ident_t { i32 0, i32 2, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @0, i32 0, i32 0) }, align 8 @1 = private unnamed_addr global %struct.ident_t { i32 0, i32 2, i32 0, i32 0, ptr @0 }, align 8
; Function Attrs: noinline nounwind optnone uwtable ; Function Attrs: noinline nounwind optnone uwtable
define dso_local void @f() { define dso_local void @f() {
@ -15,7 +15,7 @@ entry:
br label %omp_parallel br label %omp_parallel
omp_parallel: ; preds = %entry omp_parallel: ; preds = %entry
call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @1, i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @f..omp_par to void (i32*, i32*, ...)*)) call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @1, i32 0, ptr @f..omp_par)
br label %omp.par.exit.split br label %omp.par.exit.split
omp.par.exit.split: ; preds = %omp_parallel omp.par.exit.split: ; preds = %omp_parallel
@ -23,12 +23,12 @@ omp.par.exit.split: ; preds = %omp_parallel
} }
; Function Attrs: norecurse nounwind ; Function Attrs: norecurse nounwind
define internal void @f..omp_par(i32* noalias %tid.addr, i32* noalias %zero.addr) { define internal void @f..omp_par(ptr noalias %tid.addr, ptr noalias %zero.addr) {
omp.par.entry: omp.par.entry:
%tid.addr.local = alloca i32, align 4 %tid.addr.local = alloca i32, align 4
%0 = load i32, i32* %tid.addr, align 4 %0 = load i32, ptr %tid.addr, align 4
store i32 %0, i32* %tid.addr.local, align 4 store i32 %0, ptr %tid.addr.local, align 4
%tid = load i32, i32* %tid.addr.local, align 4 %tid = load i32, ptr %tid.addr.local, align 4
br label %omp.par.region br label %omp.par.region
omp.par.exit.split.exitStub: ; preds = %omp.par.outlined.exit omp.par.exit.split.exitStub: ; preds = %omp.par.outlined.exit
@ -45,7 +45,7 @@ omp.par.outlined.exit: ; preds = %omp.par.pre_finaliz
} }
; Function Attrs: nounwind ; Function Attrs: nounwind
declare !callback !2 void @__kmpc_fork_call(%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) #2 declare !callback !2 void @__kmpc_fork_call(ptr, i32, ptr, ...) #2
!2 = !{!3} !2 = !{!3}
!3 = !{i64 2, i64 -1, i64 -1, i1 true} !3 = !{i64 2, i64 -1, i64 -1, i1 true}

View File

@ -17,9 +17,9 @@
; CHECK-NEXT: Call graph node for function: 'used2'<<{{.*}}>> #uses=1 ; CHECK-NEXT: Call graph node for function: 'used2'<<{{.*}}>> #uses=1
; CHECK-EMPTY: ; CHECK-EMPTY:
@llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @used1 to i8*)] @llvm.used = appending global [1 x ptr] [ptr @used1]
@llvm.compiler.used = appending global [1 x void()*] [void ()* @used2] @llvm.compiler.used = appending global [1 x ptr] [ptr @used2]
@array = appending global [1 x i8*] [i8* bitcast (void ()* @unused to i8*)] @array = appending global [1 x ptr] [ptr @unused]
define internal void @used1() { define internal void @used1() {
entry: entry:

View File

@ -3,10 +3,10 @@
; Check that intrinsics aren't added to the call graph ; Check that intrinsics aren't added to the call graph
declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i1) declare void @llvm.memcpy.p0.p0.i32(ptr, ptr, i32, i1)
define void @f(i8* %out, i8* %in) { define void @f(ptr %out, ptr %in) {
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %out, i8* align 4 %in, i32 100, i1 false) call void @llvm.memcpy.p0.p0.i32(ptr align 4 %out, ptr align 4 %in, i32 100, i1 false)
ret void ret void
} }

View File

@ -1,7 +1,7 @@
; RUN: opt -S -print-callgraph -disable-output < %s 2>&1 | FileCheck %s ; RUN: opt -S -print-callgraph -disable-output < %s 2>&1 | FileCheck %s
declare void @llvm.experimental.patchpoint.void(i64, i32, ptr, i32, ...) declare void @llvm.experimental.patchpoint.void(i64, i32, ptr, i32, ...)
declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, ptr, i32, i32, ...) declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
define private void @f() { define private void @f() {
ret void ret void
@ -10,7 +10,7 @@ define private void @f() {
define void @calls_statepoint(ptr addrspace(1) %arg) gc "statepoint-example" { define void @calls_statepoint(ptr addrspace(1) %arg) gc "statepoint-example" {
entry: entry:
%safepoint_token = call token (i64, i32, ptr, i32, i32, ...) %safepoint_token = call token (i64, i32, ptr, i32, i32, ...)
@llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, ptr elementtype(void ()) @f, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %arg, ptr addrspace(1) %arg, ptr addrspace(1) %arg, ptr addrspace(1) %arg), "deopt" (i32 0, i32 0, i32 0, i32 10, i32 0)] @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) @f, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %arg, ptr addrspace(1) %arg, ptr addrspace(1) %arg, ptr addrspace(1) %arg), "deopt" (i32 0, i32 0, i32 0, i32 10, i32 0)]
ret void ret void
} }

View File

@ -29,14 +29,14 @@
; CHECK: Node Address:[[N4]]:single-instruction ; CHECK: Node Address:[[N4]]:single-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %arrayidx1 = getelementptr inbounds float, float* %a, i64 %i.02 ; CHECK-NEXT: %arrayidx1 = getelementptr inbounds float, ptr %a, i64 %i.02
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N6:0x[0-9a-f]*]] ; CHECK-NEXT: [def-use] to [[N6:0x[0-9a-f]*]]
; CHECK: Node Address:[[N3]]:multi-instruction ; CHECK: Node Address:[[N3]]:multi-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %arrayidx = getelementptr inbounds float, float* %b, i64 %i.02 ; CHECK-NEXT: %arrayidx = getelementptr inbounds float, ptr %b, i64 %i.02
; CHECK-NEXT: %0 = load float, float* %arrayidx, align 4 ; CHECK-NEXT: %0 = load float, ptr %arrayidx, align 4
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N7:0x[0-9a-f]*]] ; CHECK-NEXT: [def-use] to [[N7:0x[0-9a-f]*]]
@ -54,29 +54,29 @@
; CHECK: Node Address:[[N6]]:single-instruction ; CHECK: Node Address:[[N6]]:single-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: store float %add, float* %arrayidx1, align 4 ; CHECK-NEXT: store float %add, ptr %arrayidx1, align 4
; CHECK-NEXT: Edges:none! ; CHECK-NEXT: Edges:none!
;; No memory dependencies. ;; No memory dependencies.
;; void test1(unsigned long n, float * restrict a, float * restrict b) { ;; void test1(unsigned long n, ptr restrict a, ptr restrict b) {
;; for (unsigned long i = 0; i < n; i++) ;; for (unsigned long i = 0; i < n; i++)
;; a[i] = b[i] + n; ;; a[i] = b[i] + n;
;; } ;; }
define void @test1(i64 %n, float* noalias %a, float* noalias %b) { define void @test1(i64 %n, ptr noalias %a, ptr noalias %b) {
entry: entry:
%exitcond1 = icmp ne i64 0, %n %exitcond1 = icmp ne i64 0, %n
br i1 %exitcond1, label %test1.for.body, label %for.end br i1 %exitcond1, label %test1.for.body, label %for.end
test1.for.body: ; preds = %entry, %test1.for.body test1.for.body: ; preds = %entry, %test1.for.body
%i.02 = phi i64 [ %inc, %test1.for.body ], [ 0, %entry ] %i.02 = phi i64 [ %inc, %test1.for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds float, float* %b, i64 %i.02 %arrayidx = getelementptr inbounds float, ptr %b, i64 %i.02
%0 = load float, float* %arrayidx, align 4 %0 = load float, ptr %arrayidx, align 4
%conv = uitofp i64 %n to float %conv = uitofp i64 %n to float
%add = fadd float %0, %conv %add = fadd float %0, %conv
%arrayidx1 = getelementptr inbounds float, float* %a, i64 %i.02 %arrayidx1 = getelementptr inbounds float, ptr %a, i64 %i.02
store float %add, float* %arrayidx1, align 4 store float %add, ptr %arrayidx1, align 4
%inc = add i64 %i.02, 1 %inc = add i64 %i.02, 1
%exitcond = icmp ne i64 %inc, %n %exitcond = icmp ne i64 %inc, %n
br i1 %exitcond, label %test1.for.body, label %for.end br i1 %exitcond, label %test1.for.body, label %for.end
@ -116,22 +116,22 @@ for.end: ; preds = %test1.for.body, %en
; CHECK: Node Address:[[N5]]:single-instruction ; CHECK: Node Address:[[N5]]:single-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %arrayidx2 = getelementptr inbounds float, float* %a, i64 %i.02 ; CHECK-NEXT: %arrayidx2 = getelementptr inbounds float, ptr %a, i64 %i.02
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N7:0x[0-9a-f]*]] ; CHECK-NEXT: [def-use] to [[N7:0x[0-9a-f]*]]
; CHECK: Node Address:[[N4]]:multi-instruction ; CHECK: Node Address:[[N4]]:multi-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %arrayidx1 = getelementptr inbounds float, float* %a, i64 %i.02 ; CHECK-NEXT: %arrayidx1 = getelementptr inbounds float, ptr %a, i64 %i.02
; CHECK-NEXT: %1 = load float, float* %arrayidx1, align 4 ; CHECK-NEXT: %1 = load float, ptr %arrayidx1, align 4
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N8:0x[0-9a-f]*]] ; CHECK-NEXT: [def-use] to [[N8:0x[0-9a-f]*]]
; CHECK-NEXT: [memory] to [[N7]] ; CHECK-NEXT: [memory] to [[N7]]
; CHECK: Node Address:[[N3]]:multi-instruction ; CHECK: Node Address:[[N3]]:multi-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %arrayidx = getelementptr inbounds float, float* %b, i64 %i.02 ; CHECK-NEXT: %arrayidx = getelementptr inbounds float, ptr %b, i64 %i.02
; CHECK-NEXT: %0 = load float, float* %arrayidx, align 4 ; CHECK-NEXT: %0 = load float, ptr %arrayidx, align 4
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N8]] ; CHECK-NEXT: [def-use] to [[N8]]
@ -143,31 +143,31 @@ for.end: ; preds = %test1.for.body, %en
; CHECK: Node Address:[[N7]]:single-instruction ; CHECK: Node Address:[[N7]]:single-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: store float %add, float* %arrayidx2, align 4 ; CHECK-NEXT: store float %add, ptr %arrayidx2, align 4
; CHECK-NEXT: Edges:none! ; CHECK-NEXT: Edges:none!
;; Loop-independent memory dependencies. ;; Loop-independent memory dependencies.
;; void test2(unsigned long n, float * restrict a, float * restrict b) { ;; void test2(unsigned long n, ptr restrict a, ptr restrict b) {
;; for (unsigned long i = 0; i < n; i++) ;; for (unsigned long i = 0; i < n; i++)
;; a[i] = b[i] + a[i]; ;; a[i] = b[i] + a[i];
;; } ;; }
define void @test2(i64 %n, float* noalias %a, float* noalias %b) { define void @test2(i64 %n, ptr noalias %a, ptr noalias %b) {
entry: entry:
%exitcond1 = icmp ne i64 0, %n %exitcond1 = icmp ne i64 0, %n
br i1 %exitcond1, label %test2.for.body, label %for.end br i1 %exitcond1, label %test2.for.body, label %for.end
test2.for.body: ; preds = %entry, %test2.for.body test2.for.body: ; preds = %entry, %test2.for.body
%i.02 = phi i64 [ %inc, %test2.for.body ], [ 0, %entry ] %i.02 = phi i64 [ %inc, %test2.for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds float, float* %b, i64 %i.02 %arrayidx = getelementptr inbounds float, ptr %b, i64 %i.02
%0 = load float, float* %arrayidx, align 4 %0 = load float, ptr %arrayidx, align 4
%arrayidx1 = getelementptr inbounds float, float* %a, i64 %i.02 %arrayidx1 = getelementptr inbounds float, ptr %a, i64 %i.02
%1 = load float, float* %arrayidx1, align 4 %1 = load float, ptr %arrayidx1, align 4
%add = fadd float %0, %1 %add = fadd float %0, %1
%arrayidx2 = getelementptr inbounds float, float* %a, i64 %i.02 %arrayidx2 = getelementptr inbounds float, ptr %a, i64 %i.02
store float %add, float* %arrayidx2, align 4 store float %add, ptr %arrayidx2, align 4
%inc = add i64 %i.02, 1 %inc = add i64 %i.02, 1
%exitcond = icmp ne i64 %inc, %n %exitcond = icmp ne i64 %inc, %n
br i1 %exitcond, label %test2.for.body, label %for.end br i1 %exitcond, label %test2.for.body, label %for.end

View File

@ -30,21 +30,21 @@
; CHECK: Node Address:[[N6]]:single-instruction ; CHECK: Node Address:[[N6]]:single-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %arrayidx3 = getelementptr inbounds float, float* %a, i64 %i.02 ; CHECK-NEXT: %arrayidx3 = getelementptr inbounds float, ptr %a, i64 %i.02
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N8:0x[0-9a-f]*]] ; CHECK-NEXT: [def-use] to [[N8:0x[0-9a-f]*]]
; CHECK: Node Address:[[N5]]:multi-instruction ; CHECK: Node Address:[[N5]]:multi-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %sub1 = add i64 %i.02, -1 ; CHECK-NEXT: %sub1 = add i64 %i.02, -1
; CHECK-NEXT: %arrayidx2 = getelementptr inbounds float, float* %a, i64 %sub1 ; CHECK-NEXT: %arrayidx2 = getelementptr inbounds float, ptr %a, i64 %sub1
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N8]] ; CHECK-NEXT: [def-use] to [[N8]]
; CHECK: Node Address:[[N4]]:multi-instruction ; CHECK: Node Address:[[N4]]:multi-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %arrayidx = getelementptr inbounds float, float* %b, i64 %i.02 ; CHECK-NEXT: %arrayidx = getelementptr inbounds float, ptr %b, i64 %i.02
; CHECK-NEXT: %0 = load float, float* %arrayidx, align 4 ; CHECK-NEXT: %0 = load float, ptr %arrayidx, align 4
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N8]] ; CHECK-NEXT: [def-use] to [[N8]]
@ -52,7 +52,7 @@
; CHECK-NEXT: --- start of nodes in pi-block --- ; CHECK-NEXT: --- start of nodes in pi-block ---
; CHECK: Node Address:[[N9:0x[0-9a-f]*]]:single-instruction ; CHECK: Node Address:[[N9:0x[0-9a-f]*]]:single-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %1 = load float, float* %arrayidx2, align 4 ; CHECK-NEXT: %1 = load float, ptr %arrayidx2, align 4
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N10:0x[0-9a-f]*]] ; CHECK-NEXT: [def-use] to [[N10:0x[0-9a-f]*]]
@ -64,7 +64,7 @@
; CHECK: Node Address:[[N11]]:single-instruction ; CHECK: Node Address:[[N11]]:single-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: store float %add, float* %arrayidx3, align 4 ; CHECK-NEXT: store float %add, ptr %arrayidx3, align 4
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [memory] to [[N9]] ; CHECK-NEXT: [memory] to [[N9]]
; CHECK-NEXT:--- end of nodes in pi-block --- ; CHECK-NEXT:--- end of nodes in pi-block ---
@ -74,12 +74,12 @@
;; Loop-carried dependence requiring edge-reversal to expose a cycle ;; Loop-carried dependence requiring edge-reversal to expose a cycle
;; in the graph. ;; in the graph.
;; void test(unsigned long n, float * restrict a, float * restrict b) { ;; void test(unsigned long n, ptr restrict a, ptr restrict b) {
;; for (unsigned long i = 1; i < n-1; i++) ;; for (unsigned long i = 1; i < n-1; i++)
;; a[i] = b[i] + a[i-1]; ;; a[i] = b[i] + a[i-1];
;; } ;; }
define void @test1(i64 %n, float* noalias %a, float* noalias %b) { define void @test1(i64 %n, ptr noalias %a, ptr noalias %b) {
entry: entry:
%sub = add i64 %n, -1 %sub = add i64 %n, -1
%cmp1 = icmp ult i64 1, %sub %cmp1 = icmp ult i64 1, %sub
@ -87,14 +87,14 @@ entry:
test1.for.body: ; preds = %entry, %test1.for.body test1.for.body: ; preds = %entry, %test1.for.body
%i.02 = phi i64 [ %inc, %test1.for.body ], [ 1, %entry ] %i.02 = phi i64 [ %inc, %test1.for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds float, float* %b, i64 %i.02 %arrayidx = getelementptr inbounds float, ptr %b, i64 %i.02
%0 = load float, float* %arrayidx, align 4 %0 = load float, ptr %arrayidx, align 4
%sub1 = add i64 %i.02, -1 %sub1 = add i64 %i.02, -1
%arrayidx2 = getelementptr inbounds float, float* %a, i64 %sub1 %arrayidx2 = getelementptr inbounds float, ptr %a, i64 %sub1
%1 = load float, float* %arrayidx2, align 4 %1 = load float, ptr %arrayidx2, align 4
%add = fadd float %0, %1 %add = fadd float %0, %1
%arrayidx3 = getelementptr inbounds float, float* %a, i64 %i.02 %arrayidx3 = getelementptr inbounds float, ptr %a, i64 %i.02
store float %add, float* %arrayidx3, align 4 store float %add, ptr %arrayidx3, align 4
%inc = add i64 %i.02, 1 %inc = add i64 %i.02, 1
%cmp = icmp ult i64 %inc, %sub %cmp = icmp ult i64 %inc, %sub
br i1 %cmp, label %test1.for.body, label %for.end br i1 %cmp, label %test1.for.body, label %for.end
@ -134,23 +134,23 @@ for.end: ; preds = %test1.for.body, %en
; CHECK: Node Address:[[N6]]:single-instruction ; CHECK: Node Address:[[N6]]:single-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %arrayidx3 = getelementptr inbounds float, float* %a, i64 %i.02 ; CHECK-NEXT: %arrayidx3 = getelementptr inbounds float, ptr %a, i64 %i.02
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N8:0x[0-9a-f]*]] ; CHECK-NEXT: [def-use] to [[N8:0x[0-9a-f]*]]
; CHECK: Node Address:[[N5]]:multi-instruction ; CHECK: Node Address:[[N5]]:multi-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %add1 = add i64 %i.02, 1 ; CHECK-NEXT: %add1 = add i64 %i.02, 1
; CHECK-NEXT: %arrayidx2 = getelementptr inbounds float, float* %a, i64 %add1 ; CHECK-NEXT: %arrayidx2 = getelementptr inbounds float, ptr %a, i64 %add1
; CHECK-NEXT: %1 = load float, float* %arrayidx2, align 4 ; CHECK-NEXT: %1 = load float, ptr %arrayidx2, align 4
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N9:0x[0-9a-f]*]] ; CHECK-NEXT: [def-use] to [[N9:0x[0-9a-f]*]]
; CHECK-NEXT: [memory] to [[N8]] ; CHECK-NEXT: [memory] to [[N8]]
; CHECK: Node Address:[[N4]]:multi-instruction ; CHECK: Node Address:[[N4]]:multi-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %arrayidx = getelementptr inbounds float, float* %b, i64 %i.02 ; CHECK-NEXT: %arrayidx = getelementptr inbounds float, ptr %b, i64 %i.02
; CHECK-NEXT: %0 = load float, float* %arrayidx, align 4 ; CHECK-NEXT: %0 = load float, ptr %arrayidx, align 4
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N9]] ; CHECK-NEXT: [def-use] to [[N9]]
@ -162,17 +162,17 @@ for.end: ; preds = %test1.for.body, %en
; CHECK: Node Address:[[N8]]:single-instruction ; CHECK: Node Address:[[N8]]:single-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: store float %add, float* %arrayidx3, align 4 ; CHECK-NEXT: store float %add, ptr %arrayidx3, align 4
; CHECK-NEXT: Edges:none! ; CHECK-NEXT: Edges:none!
;; Forward loop-carried dependence *not* causing a cycle. ;; Forward loop-carried dependence *not* causing a cycle.
;; void test2(unsigned long n, float * restrict a, float * restrict b) { ;; void test2(unsigned long n, ptr restrict a, ptr restrict b) {
;; for (unsigned long i = 1; i < n-1; i++) ;; for (unsigned long i = 1; i < n-1; i++)
;; a[i] = b[i] + a[i+1]; ;; a[i] = b[i] + a[i+1];
;; } ;; }
define void @test2(i64 %n, float* noalias %a, float* noalias %b) { define void @test2(i64 %n, ptr noalias %a, ptr noalias %b) {
entry: entry:
%sub = add i64 %n, -1 %sub = add i64 %n, -1
%cmp1 = icmp ult i64 1, %sub %cmp1 = icmp ult i64 1, %sub
@ -180,14 +180,14 @@ entry:
test2.for.body: ; preds = %entry, %test2.for.body test2.for.body: ; preds = %entry, %test2.for.body
%i.02 = phi i64 [ %inc, %test2.for.body ], [ 1, %entry ] %i.02 = phi i64 [ %inc, %test2.for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds float, float* %b, i64 %i.02 %arrayidx = getelementptr inbounds float, ptr %b, i64 %i.02
%0 = load float, float* %arrayidx, align 4 %0 = load float, ptr %arrayidx, align 4
%add1 = add i64 %i.02, 1 %add1 = add i64 %i.02, 1
%arrayidx2 = getelementptr inbounds float, float* %a, i64 %add1 %arrayidx2 = getelementptr inbounds float, ptr %a, i64 %add1
%1 = load float, float* %arrayidx2, align 4 %1 = load float, ptr %arrayidx2, align 4
%add = fadd float %0, %1 %add = fadd float %0, %1
%arrayidx3 = getelementptr inbounds float, float* %a, i64 %i.02 %arrayidx3 = getelementptr inbounds float, ptr %a, i64 %i.02
store float %add, float* %arrayidx3, align 4 store float %add, ptr %arrayidx3, align 4
%inc = add i64 %i.02, 1 %inc = add i64 %i.02, 1
%cmp = icmp ult i64 %inc, %sub %cmp = icmp ult i64 %inc, %sub
br i1 %cmp, label %test2.for.body, label %for.end br i1 %cmp, label %test2.for.body, label %for.end

View File

@ -58,40 +58,40 @@
; CHECK: Node Address:[[N14]]:multi-instruction ; CHECK: Node Address:[[N14]]:multi-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %4 = mul nsw i64 %i.04, %n ; CHECK-NEXT: %4 = mul nsw i64 %i.04, %n
; CHECK-NEXT: %arrayidx10 = getelementptr inbounds float, float* %a, i64 %4 ; CHECK-NEXT: %arrayidx10 = getelementptr inbounds float, ptr %a, i64 %4
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N6]] ; CHECK-NEXT: [def-use] to [[N6]]
; CHECK: Node Address:[[N6]]:single-instruction ; CHECK: Node Address:[[N6]]:single-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %arrayidx11 = getelementptr inbounds float, float* %arrayidx10, i64 %j.02 ; CHECK-NEXT: %arrayidx11 = getelementptr inbounds float, ptr %arrayidx10, i64 %j.02
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N18:0x[0-9a-f]*]] ; CHECK-NEXT: [def-use] to [[N18:0x[0-9a-f]*]]
; CHECK: Node Address:[[N13]]:multi-instruction ; CHECK: Node Address:[[N13]]:multi-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %2 = mul nsw i64 %i.04, %n ; CHECK-NEXT: %2 = mul nsw i64 %i.04, %n
; CHECK-NEXT: %arrayidx6 = getelementptr inbounds float, float* %a, i64 %2 ; CHECK-NEXT: %arrayidx6 = getelementptr inbounds float, ptr %a, i64 %2
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N8]] ; CHECK-NEXT: [def-use] to [[N8]]
; CHECK: Node Address:[[N8]]:single-instruction ; CHECK: Node Address:[[N8]]:single-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %arrayidx8 = getelementptr inbounds float, float* %arrayidx6, i64 %sub7 ; CHECK-NEXT: %arrayidx8 = getelementptr inbounds float, ptr %arrayidx6, i64 %sub7
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N18]] ; CHECK-NEXT: [def-use] to [[N18]]
; CHECK: Node Address:[[N12]]:multi-instruction ; CHECK: Node Address:[[N12]]:multi-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %0 = mul nsw i64 %i.04, %n ; CHECK-NEXT: %0 = mul nsw i64 %i.04, %n
; CHECK-NEXT: %arrayidx = getelementptr inbounds float, float* %b, i64 %0 ; CHECK-NEXT: %arrayidx = getelementptr inbounds float, ptr %b, i64 %0
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N4]] ; CHECK-NEXT: [def-use] to [[N4]]
; CHECK: Node Address:[[N4]]:multi-instruction ; CHECK: Node Address:[[N4]]:multi-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %arrayidx5 = getelementptr inbounds float, float* %arrayidx, i64 %j.02 ; CHECK-NEXT: %arrayidx5 = getelementptr inbounds float, ptr %arrayidx, i64 %j.02
; CHECK-NEXT: %1 = load float, float* %arrayidx5, align 4 ; CHECK-NEXT: %1 = load float, ptr %arrayidx5, align 4
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N18]] ; CHECK-NEXT: [def-use] to [[N18]]
@ -99,7 +99,7 @@
; CHECK-NEXT:--- start of nodes in pi-block --- ; CHECK-NEXT:--- start of nodes in pi-block ---
; CHECK: Node Address:[[N22:0x[0-9a-f]*]]:single-instruction ; CHECK: Node Address:[[N22:0x[0-9a-f]*]]:single-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %3 = load float, float* %arrayidx8, align 4 ; CHECK-NEXT: %3 = load float, ptr %arrayidx8, align 4
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N23:0x[0-9a-f]*]] ; CHECK-NEXT: [def-use] to [[N23:0x[0-9a-f]*]]
@ -111,7 +111,7 @@
; CHECK: Node Address:[[N24]]:single-instruction ; CHECK: Node Address:[[N24]]:single-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: store float %add, float* %arrayidx11, align 4 ; CHECK-NEXT: store float %add, ptr %arrayidx11, align 4
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [memory] to [[N22]] ; CHECK-NEXT: [memory] to [[N22]]
; CHECK-NEXT:--- end of nodes in pi-block --- ; CHECK-NEXT:--- end of nodes in pi-block ---
@ -154,7 +154,7 @@
;; a[i][j] = b[i][j] + a[i][j-1]; ;; a[i][j] = b[i][j] + a[i][j-1];
;; } ;; }
define void @test1(i64 %n, float* noalias %a, float* noalias %b) { define void @test1(i64 %n, ptr noalias %a, ptr noalias %b) {
entry: entry:
%exitcond3 = icmp ne i64 0, %n %exitcond3 = icmp ne i64 0, %n
br i1 %exitcond3, label %test1.for.cond1.preheader, label %for.end14 br i1 %exitcond3, label %test1.for.cond1.preheader, label %for.end14
@ -168,19 +168,19 @@ test1.for.cond1.preheader: ; preds = %entry, %for.i
for.body4: ; preds = %test1.for.cond1.preheader, %for.body4 for.body4: ; preds = %test1.for.cond1.preheader, %for.body4
%j.02 = phi i64 [ %inc, %for.body4 ], [ 1, %test1.for.cond1.preheader ] %j.02 = phi i64 [ %inc, %for.body4 ], [ 1, %test1.for.cond1.preheader ]
%0 = mul nsw i64 %i.04, %n %0 = mul nsw i64 %i.04, %n
%arrayidx = getelementptr inbounds float, float* %b, i64 %0 %arrayidx = getelementptr inbounds float, ptr %b, i64 %0
%arrayidx5 = getelementptr inbounds float, float* %arrayidx, i64 %j.02 %arrayidx5 = getelementptr inbounds float, ptr %arrayidx, i64 %j.02
%1 = load float, float* %arrayidx5, align 4 %1 = load float, ptr %arrayidx5, align 4
%2 = mul nsw i64 %i.04, %n %2 = mul nsw i64 %i.04, %n
%arrayidx6 = getelementptr inbounds float, float* %a, i64 %2 %arrayidx6 = getelementptr inbounds float, ptr %a, i64 %2
%sub7 = add i64 %j.02, -1 %sub7 = add i64 %j.02, -1
%arrayidx8 = getelementptr inbounds float, float* %arrayidx6, i64 %sub7 %arrayidx8 = getelementptr inbounds float, ptr %arrayidx6, i64 %sub7
%3 = load float, float* %arrayidx8, align 4 %3 = load float, ptr %arrayidx8, align 4
%add = fadd float %1, %3 %add = fadd float %1, %3
%4 = mul nsw i64 %i.04, %n %4 = mul nsw i64 %i.04, %n
%arrayidx10 = getelementptr inbounds float, float* %a, i64 %4 %arrayidx10 = getelementptr inbounds float, ptr %a, i64 %4
%arrayidx11 = getelementptr inbounds float, float* %arrayidx10, i64 %j.02 %arrayidx11 = getelementptr inbounds float, ptr %arrayidx10, i64 %j.02
store float %add, float* %arrayidx11, align 4 store float %add, ptr %arrayidx11, align 4
%inc = add i64 %j.02, 1 %inc = add i64 %j.02, 1
%cmp2 = icmp ult i64 %inc, %sub %cmp2 = icmp ult i64 %inc, %sub
br i1 %cmp2, label %for.body4, label %for.inc12 br i1 %cmp2, label %for.body4, label %for.inc12
@ -253,27 +253,27 @@ for.end14: ; preds = %for.inc12, %entry
; CHECK: Node Address:[[N13]]:multi-instruction ; CHECK: Node Address:[[N13]]:multi-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %4 = mul nsw i64 %i.04, %n ; CHECK-NEXT: %4 = mul nsw i64 %i.04, %n
; CHECK-NEXT: %arrayidx10 = getelementptr inbounds float, float* %a, i64 %4 ; CHECK-NEXT: %arrayidx10 = getelementptr inbounds float, ptr %a, i64 %4
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N5]] ; CHECK-NEXT: [def-use] to [[N5]]
; CHECK: Node Address:[[N5]]:single-instruction ; CHECK: Node Address:[[N5]]:single-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %arrayidx11 = getelementptr inbounds float, float* %arrayidx10, i64 %j.02 ; CHECK-NEXT: %arrayidx11 = getelementptr inbounds float, ptr %arrayidx10, i64 %j.02
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N17:0x[0-9a-f]*]] ; CHECK-NEXT: [def-use] to [[N17:0x[0-9a-f]*]]
; CHECK: Node Address:[[N12]]:multi-instruction ; CHECK: Node Address:[[N12]]:multi-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %2 = mul nsw i64 %i.04, %n ; CHECK-NEXT: %2 = mul nsw i64 %i.04, %n
; CHECK-NEXT: %arrayidx6 = getelementptr inbounds float, float* %a, i64 %2 ; CHECK-NEXT: %arrayidx6 = getelementptr inbounds float, ptr %a, i64 %2
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N7]] ; CHECK-NEXT: [def-use] to [[N7]]
; CHECK: Node Address:[[N7]]:multi-instruction ; CHECK: Node Address:[[N7]]:multi-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %arrayidx8 = getelementptr inbounds float, float* %arrayidx6, i64 %add7 ; CHECK-NEXT: %arrayidx8 = getelementptr inbounds float, ptr %arrayidx6, i64 %add7
; CHECK-NEXT: %3 = load float, float* %arrayidx8, align 4 ; CHECK-NEXT: %3 = load float, ptr %arrayidx8, align 4
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N20:0x[0-9a-f]*]] ; CHECK-NEXT: [def-use] to [[N20:0x[0-9a-f]*]]
; CHECK-NEXT: [memory] to [[N17]] ; CHECK-NEXT: [memory] to [[N17]]
@ -281,14 +281,14 @@ for.end14: ; preds = %for.inc12, %entry
; CHECK: Node Address:[[N11]]:multi-instruction ; CHECK: Node Address:[[N11]]:multi-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %0 = mul nsw i64 %i.04, %n ; CHECK-NEXT: %0 = mul nsw i64 %i.04, %n
; CHECK-NEXT: %arrayidx = getelementptr inbounds float, float* %b, i64 %0 ; CHECK-NEXT: %arrayidx = getelementptr inbounds float, ptr %b, i64 %0
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N3]] ; CHECK-NEXT: [def-use] to [[N3]]
; CHECK: Node Address:[[N3]]:multi-instruction ; CHECK: Node Address:[[N3]]:multi-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: %arrayidx5 = getelementptr inbounds float, float* %arrayidx, i64 %j.02 ; CHECK-NEXT: %arrayidx5 = getelementptr inbounds float, ptr %arrayidx, i64 %j.02
; CHECK-NEXT: %1 = load float, float* %arrayidx5, align 4 ; CHECK-NEXT: %1 = load float, ptr %arrayidx5, align 4
; CHECK-NEXT: Edges: ; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N20]] ; CHECK-NEXT: [def-use] to [[N20]]
@ -300,7 +300,7 @@ for.end14: ; preds = %for.inc12, %entry
; CHECK: Node Address:[[N17]]:single-instruction ; CHECK: Node Address:[[N17]]:single-instruction
; CHECK-NEXT: Instructions: ; CHECK-NEXT: Instructions:
; CHECK-NEXT: store float %add, float* %arrayidx11, align 4 ; CHECK-NEXT: store float %add, ptr %arrayidx11, align 4
; CHECK-NEXT: Edges:none! ; CHECK-NEXT: Edges:none!
; CHECK: Node Address:[[N23:0x[0-9a-f]*]]:single-instruction ; CHECK: Node Address:[[N23:0x[0-9a-f]*]]:single-instruction
@ -340,7 +340,7 @@ for.end14: ; preds = %for.inc12, %entry
;; a[i][j] = b[i][j] + a[i][j+1]; ;; a[i][j] = b[i][j] + a[i][j+1];
;; } ;; }
define void @test2(i64 %n, float* noalias %a, float* noalias %b) { define void @test2(i64 %n, ptr noalias %a, ptr noalias %b) {
entry: entry:
%exitcond3 = icmp ne i64 0, %n %exitcond3 = icmp ne i64 0, %n
br i1 %exitcond3, label %test2.for.cond1.preheader, label %for.end14 br i1 %exitcond3, label %test2.for.cond1.preheader, label %for.end14
@ -354,19 +354,19 @@ test2.for.cond1.preheader: ; preds = %entry, %for.i
for.body4: ; preds = %test2.for.cond1.preheader, %for.body4 for.body4: ; preds = %test2.for.cond1.preheader, %for.body4
%j.02 = phi i64 [ %inc, %for.body4 ], [ 1, %test2.for.cond1.preheader ] %j.02 = phi i64 [ %inc, %for.body4 ], [ 1, %test2.for.cond1.preheader ]
%0 = mul nsw i64 %i.04, %n %0 = mul nsw i64 %i.04, %n
%arrayidx = getelementptr inbounds float, float* %b, i64 %0 %arrayidx = getelementptr inbounds float, ptr %b, i64 %0
%arrayidx5 = getelementptr inbounds float, float* %arrayidx, i64 %j.02 %arrayidx5 = getelementptr inbounds float, ptr %arrayidx, i64 %j.02
%1 = load float, float* %arrayidx5, align 4 %1 = load float, ptr %arrayidx5, align 4
%2 = mul nsw i64 %i.04, %n %2 = mul nsw i64 %i.04, %n
%arrayidx6 = getelementptr inbounds float, float* %a, i64 %2 %arrayidx6 = getelementptr inbounds float, ptr %a, i64 %2
%add7 = add i64 %j.02, 1 %add7 = add i64 %j.02, 1
%arrayidx8 = getelementptr inbounds float, float* %arrayidx6, i64 %add7 %arrayidx8 = getelementptr inbounds float, ptr %arrayidx6, i64 %add7
%3 = load float, float* %arrayidx8, align 4 %3 = load float, ptr %arrayidx8, align 4
%add = fadd float %1, %3 %add = fadd float %1, %3
%4 = mul nsw i64 %i.04, %n %4 = mul nsw i64 %i.04, %n
%arrayidx10 = getelementptr inbounds float, float* %a, i64 %4 %arrayidx10 = getelementptr inbounds float, ptr %a, i64 %4
%arrayidx11 = getelementptr inbounds float, float* %arrayidx10, i64 %j.02 %arrayidx11 = getelementptr inbounds float, ptr %arrayidx10, i64 %j.02
store float %add, float* %arrayidx11, align 4 store float %add, ptr %arrayidx11, align 4
%inc = add i64 %j.02, 1 %inc = add i64 %j.02, 1
%cmp2 = icmp ult i64 %inc, %sub %cmp2 = icmp ult i64 %inc, %sub
br i1 %cmp2, label %for.body4, label %for.inc12 br i1 %cmp2, label %for.body4, label %for.inc12

View File

@ -10,7 +10,7 @@ target datalayout = "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512"
; printed properly and that multiple memory dependencies on a single edge ; printed properly and that multiple memory dependencies on a single edge
; are shown in the full dot graph. ; are shown in the full dot graph.
; ;
; void foo(float * restrict A, float * restrict B, int n) { ; void foo(ptr restrict A, ptr restrict B, int n) {
; for (int i = 0; i < n; i++) { ; for (int i = 0; i < n; i++) {
; A[i] = A[i] + B[i]; ; A[i] = A[i] + B[i];
; B[i+1] = A[i] + 1; ; B[i+1] = A[i] + 1;
@ -24,22 +24,22 @@ target datalayout = "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512"
; CHECK: {{Node0x.*}} -> {{Node0x.*}}[label="[rooted]"] ; CHECK: {{Node0x.*}} -> {{Node0x.*}}[label="[rooted]"]
; CHECK-COUNT-6: {{Node0x.*}} -> {{Node0x.*}}[label="[def-use]"] ; CHECK-COUNT-6: {{Node0x.*}} -> {{Node0x.*}}[label="[def-use]"]
; CHECK-NOT: {{Node0x.*}} -> {{Node0x.*}}[label="[def-use]"] ; CHECK-NOT: {{Node0x.*}} -> {{Node0x.*}}[label="[def-use]"]
; CHECK: [shape=record,label="{\<kind:single-instruction\>\n %arrayidx10 = getelementptr inbounds float, float* %B, i64 %indvars.iv.next\n}"]; ; CHECK: [shape=record,label="{\<kind:single-instruction\>\n %arrayidx10 = getelementptr inbounds float, ptr %B, i64 %indvars.iv.next\n}"];
; CHECK: [shape=record,label="{\<kind:multi-instruction\>\n %arrayidx = getelementptr inbounds float, float* %A, i64 %indvars.iv\n %0 = load float, float* %arrayidx, align 4\n}"]; ; CHECK: [shape=record,label="{\<kind:multi-instruction\>\n %arrayidx = getelementptr inbounds float, ptr %A, i64 %indvars.iv\n %0 = load float, ptr %arrayidx, align 4\n}"];
; CHECK: {{Node0x.*}} -> {{Node0x.*}}[label="[consistent anti [0|<]!, consistent input [0|<]!]"] ; CHECK: {{Node0x.*}} -> {{Node0x.*}}[label="[consistent anti [0|<]!, consistent input [0|<]!]"]
; CHECK: [shape=record,label="{\<kind:pi-block\>\n--- start of nodes in pi-block ---\n\<kind:single-instruction\>\n %1 = load float, float* %arrayidx2, align 4\n\n\<kind:single-instruction\>\n %add = fadd fast float %0, %1\n\n\<kind:single-instruction\>\n store float %add, float* %arrayidx4, align 4\n\n\<kind:multi-instruction\>\n %2 = load float, float* %arrayidx6, align 4\n %add7 = fadd fast float %2, 1.000000e+00\n\n\<kind:single-instruction\>\n store float %add7, float* %arrayidx10, align 4\n--- end of nodes in pi-block ---\n}"]; ; CHECK: [shape=record,label="{\<kind:pi-block\>\n--- start of nodes in pi-block ---\n\<kind:single-instruction\>\n %1 = load float, ptr %arrayidx2, align 4\n\n\<kind:single-instruction\>\n %add = fadd fast float %0, %1\n\n\<kind:single-instruction\>\n store float %add, ptr %arrayidx4, align 4\n\n\<kind:multi-instruction\>\n %2 = load float, ptr %arrayidx6, align 4\n %add7 = fadd fast float %2, 1.000000e+00\n\n\<kind:single-instruction\>\n store float %add7, ptr %arrayidx10, align 4\n--- end of nodes in pi-block ---\n}"];
; CHECK-ONLY: digraph "DDG for 'foo.for.body'" ; CHECK-ONLY: digraph "DDG for 'foo.for.body'"
; CHECK-ONLY-NEXT: label="DDG for 'foo.for.body'"; ; CHECK-ONLY-NEXT: label="DDG for 'foo.for.body'";
; CHECK-ONLY: [shape=record,label="{pi-block\nwith\n2 nodes\n}"]; ; CHECK-ONLY: [shape=record,label="{pi-block\nwith\n2 nodes\n}"];
; CHECK-ONLY-COUNT-6: {{Node0x.*}} -> {{Node0x.*}}[label="[def-use]"]; ; CHECK-ONLY-COUNT-6: {{Node0x.*}} -> {{Node0x.*}}[label="[def-use]"];
; CHECK-NOT: {{Node0x.*}} -> {{Node0x.*}}[label="[def-use]"]; ; CHECK-NOT: {{Node0x.*}} -> {{Node0x.*}}[label="[def-use]"];
; CHECK-ONLY: [shape=record,label="{ %arrayidx10 = getelementptr inbounds float, float* %B, i64 %indvars.iv.next\n}"]; ; CHECK-ONLY: [shape=record,label="{ %arrayidx10 = getelementptr inbounds float, ptr %B, i64 %indvars.iv.next\n}"];
; CHECK-ONLY: [shape=record,label="{ %arrayidx = getelementptr inbounds float, float* %A, i64 %indvars.iv\n %0 = load float, float* %arrayidx, align 4\n}"]; ; CHECK-ONLY: [shape=record,label="{ %arrayidx = getelementptr inbounds float, ptr %A, i64 %indvars.iv\n %0 = load float, ptr %arrayidx, align 4\n}"];
; CHECK-ONLY: {{Node0x.*}} -> {{Node0x.*}}[label="[memory]"] ; CHECK-ONLY: {{Node0x.*}} -> {{Node0x.*}}[label="[memory]"]
; CHECK-ONLY: [shape=record,label="{pi-block\nwith\n5 nodes\n}"]; ; CHECK-ONLY: [shape=record,label="{pi-block\nwith\n5 nodes\n}"];
define void @foo(float* noalias %A, float* noalias %B, i32 signext %n) { define void @foo(ptr noalias %A, ptr noalias %B, i32 signext %n) {
entry: entry:
%cmp1 = icmp sgt i32 %n, 0 %cmp1 = icmp sgt i32 %n, 0
br i1 %cmp1, label %for.body.preheader, label %for.end br i1 %cmp1, label %for.body.preheader, label %for.end
@ -50,19 +50,19 @@ for.body.preheader: ; preds = %entry
for.body: ; preds = %for.body.preheader, %for.body for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds float, float* %A, i64 %indvars.iv %arrayidx = getelementptr inbounds float, ptr %A, i64 %indvars.iv
%0 = load float, float* %arrayidx, align 4 %0 = load float, ptr %arrayidx, align 4
%arrayidx2 = getelementptr inbounds float, float* %B, i64 %indvars.iv %arrayidx2 = getelementptr inbounds float, ptr %B, i64 %indvars.iv
%1 = load float, float* %arrayidx2, align 4 %1 = load float, ptr %arrayidx2, align 4
%add = fadd fast float %0, %1 %add = fadd fast float %0, %1
%arrayidx4 = getelementptr inbounds float, float* %A, i64 %indvars.iv %arrayidx4 = getelementptr inbounds float, ptr %A, i64 %indvars.iv
store float %add, float* %arrayidx4, align 4 store float %add, ptr %arrayidx4, align 4
%arrayidx6 = getelementptr inbounds float, float* %A, i64 %indvars.iv %arrayidx6 = getelementptr inbounds float, ptr %A, i64 %indvars.iv
%2 = load float, float* %arrayidx6, align 4 %2 = load float, ptr %arrayidx6, align 4
%add7 = fadd fast float %2, 1.000000e+00 %add7 = fadd fast float %2, 1.000000e+00
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx10 = getelementptr inbounds float, float* %B, i64 %indvars.iv.next %arrayidx10 = getelementptr inbounds float, ptr %B, i64 %indvars.iv.next
store float %add7, float* %arrayidx10, align 4 store float %add7, ptr %arrayidx10, align 4
%exitcond = icmp ne i64 %indvars.iv.next, %wide.trip.count %exitcond = icmp ne i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond, label %for.body, label %for.end.loopexit br i1 %exitcond, label %for.body, label %for.end.loopexit

View File

@ -14,14 +14,14 @@
; CHECK: %i2.03 = phi i64 [ 0, %for.body.lr.ph ], [ %inc2, %test1.for.body ] ; CHECK: %i2.03 = phi i64 [ 0, %for.body.lr.ph ], [ %inc2, %test1.for.body ]
;; // Two separate components in the graph. Root node must link to both. ;; // Two separate components in the graph. Root node must link to both.
;; void test1(unsigned long n, float * restrict a, float * restrict b) { ;; void test1(unsigned long n, ptr restrict a, ptr restrict b) {
;; for (unsigned long i1 = 0, i2 = 0; i1 < n; i1++, i2++) { ;; for (unsigned long i1 = 0, i2 = 0; i1 < n; i1++, i2++) {
;; a[i1] = 1; ;; a[i1] = 1;
;; b[i2] = -1; ;; b[i2] = -1;
;; } ;; }
;; } ;; }
define void @test1(i64 %n, float* noalias %a, float* noalias %b) { define void @test1(i64 %n, ptr noalias %a, ptr noalias %b) {
entry: entry:
%cmp1 = icmp ult i64 0, %n %cmp1 = icmp ult i64 0, %n
br i1 %cmp1, label %for.body.lr.ph, label %for.end br i1 %cmp1, label %for.body.lr.ph, label %for.end
@ -32,10 +32,10 @@ for.body.lr.ph: ; preds = %entry
test1.for.body: ; preds = %for.body.lr.ph, %test1.for.body test1.for.body: ; preds = %for.body.lr.ph, %test1.for.body
%i2.03 = phi i64 [ 0, %for.body.lr.ph ], [ %inc2, %test1.for.body ] %i2.03 = phi i64 [ 0, %for.body.lr.ph ], [ %inc2, %test1.for.body ]
%i1.02 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %test1.for.body ] %i1.02 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %test1.for.body ]
%arrayidx = getelementptr inbounds float, float* %a, i64 %i1.02 %arrayidx = getelementptr inbounds float, ptr %a, i64 %i1.02
store float 1.000000e+00, float* %arrayidx, align 4 store float 1.000000e+00, ptr %arrayidx, align 4
%arrayidx1 = getelementptr inbounds float, float* %b, i64 %i2.03 %arrayidx1 = getelementptr inbounds float, ptr %b, i64 %i2.03
store float -1.000000e+00, float* %arrayidx1, align 4 store float -1.000000e+00, ptr %arrayidx1, align 4
%inc = add i64 %i1.02, 1 %inc = add i64 %i1.02, 1
%inc2 = add i64 %i2.03, 1 %inc2 = add i64 %i2.03, 1
%cmp = icmp ult i64 %inc, %n %cmp = icmp ult i64 %inc, %n

View File

@ -72,7 +72,7 @@ exit:
} }
; Make sure that sdiv is NOT marked as mustexec. ; Make sure that sdiv is NOT marked as mustexec.
define void @test_impossible_exit_in_untaken_block(i1 %cond, i32 %a, i32 %b, i32* %p) { define void @test_impossible_exit_in_untaken_block(i1 %cond, i32 %a, i32 %b, ptr %p) {
; CHECK-LABEL: @test_impossible_exit_in_untaken_block( ; CHECK-LABEL: @test_impossible_exit_in_untaken_block(
; CHECK-NEXT: entry: ; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[LOOP:%.*]] ; CHECK-NEXT: br label [[LOOP:%.*]]
@ -82,7 +82,7 @@ define void @test_impossible_exit_in_untaken_block(i1 %cond, i32 %a, i32 %b, i32
; CHECK: maybe_taken: ; CHECK: maybe_taken:
; CHECK-NOT: mustexec ; CHECK-NOT: mustexec
; CHECK-NEXT: [[DIV:%.*]] = sdiv i32 [[A:%.*]], [[B:%.*]] ; CHECK-NEXT: [[DIV:%.*]] = sdiv i32 [[A:%.*]], [[B:%.*]]
; CHECK-NEXT: store i32 [[DIV]], i32* [[P:%.*]] ; CHECK-NEXT: store i32 [[DIV]], ptr [[P:%.*]]
; CHECK-NEXT: br i1 true, label [[BACKEDGE]], label [[EXIT:%.*]] ; CHECK-NEXT: br i1 true, label [[BACKEDGE]], label [[EXIT:%.*]]
; CHECK: backedge: ; CHECK: backedge:
; CHECK-NEXT: [[IV_NEXT]] = add i32 [[IV]], 1 ; (mustexec in: loop) ; CHECK-NEXT: [[IV_NEXT]] = add i32 [[IV]], 1 ; (mustexec in: loop)
@ -99,7 +99,7 @@ loop:
maybe_taken: maybe_taken:
%div = sdiv i32 %a, %b %div = sdiv i32 %a, %b
store i32 %div, i32* %p store i32 %div, ptr %p
br i1 true, label %backedge, label %exit br i1 true, label %backedge, label %exit
backedge: backedge:

View File

@ -1,11 +1,11 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -disable-output -print-mustexecute %s 2>&1 | FileCheck %s ; RUN: opt -disable-output -print-mustexecute %s 2>&1 | FileCheck %s
define i1 @header_with_icf(i32* noalias %p, i32 %high) { define i1 @header_with_icf(ptr noalias %p, i32 %high) {
; CHECK-LABEL: @header_with_icf( ; CHECK-LABEL: @header_with_icf(
; CHECK-LABEL: loop: ; CHECK-LABEL: loop:
; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ] ; (mustexec in: loop) ; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ] ; (mustexec in: loop)
; CHECK: %v = load i32, i32* %p, align 4 ; (mustexec in: loop) ; CHECK: %v = load i32, ptr %p, align 4 ; (mustexec in: loop)
; CHECK: call void @maythrow_and_use(i32 %v) ; (mustexec in: loop) ; CHECK: call void @maythrow_and_use(i32 %v) ; (mustexec in: loop)
; CHECK-NOT: mustexec ; CHECK-NOT: mustexec
@ -14,7 +14,7 @@ entry:
loop: loop:
%iv = phi i32 [0, %entry], [%iv.next, %loop] %iv = phi i32 [0, %entry], [%iv.next, %loop]
%v = load i32, i32* %p %v = load i32, ptr %p
call void @maythrow_and_use(i32 %v) call void @maythrow_and_use(i32 %v)
%iv.next = add nsw nuw i32 %iv, 1 %iv.next = add nsw nuw i32 %iv, 1
%exit.test = icmp slt i32 %iv, %high %exit.test = icmp slt i32 %iv, %high
@ -24,11 +24,11 @@ exit:
ret i1 false ret i1 false
} }
define i1 @split_header(i32* noalias %p, i32 %high) { define i1 @split_header(ptr noalias %p, i32 %high) {
; CHECK-LABEL: @split_header( ; CHECK-LABEL: @split_header(
; CHECK-LABEL: loop: ; CHECK-LABEL: loop:
; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %next ] ; (mustexec in: loop) ; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %next ] ; (mustexec in: loop)
; CHECK: %v = load i32, i32* %p, align 4 ; (mustexec in: loop) ; CHECK: %v = load i32, ptr %p, align 4 ; (mustexec in: loop)
; CHECK: br label %next ; (mustexec in: loop) ; CHECK: br label %next ; (mustexec in: loop)
; CHECK-NOT: mustexec ; CHECK-NOT: mustexec
entry: entry:
@ -36,7 +36,7 @@ entry:
loop: loop:
%iv = phi i32 [0, %entry], [%iv.next, %next] %iv = phi i32 [0, %entry], [%iv.next, %next]
%v = load i32, i32* %p %v = load i32, ptr %p
br label %next br label %next
next: next:
call void @maythrow_and_use(i32 %v) call void @maythrow_and_use(i32 %v)
@ -50,13 +50,13 @@ exit:
; FIXME: everything in inner loop header should be must execute ; FIXME: everything in inner loop header should be must execute
; for outer as well ; for outer as well
define i1 @nested(i32* noalias %p, i32 %high) { define i1 @nested(ptr noalias %p, i32 %high) {
; CHECK-LABEL: @nested ; CHECK-LABEL: @nested
; CHECK-LABEL: loop: ; preds = %next ; CHECK-LABEL: loop: ; preds = %next
; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %next ] ; (mustexec in: loop) ; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %next ] ; (mustexec in: loop)
; CHECK: br label %inner_loop ; (mustexec in: loop) ; CHECK: br label %inner_loop ; (mustexec in: loop)
; CHECK-LABEL: inner_loop: ; CHECK-LABEL: inner_loop:
; CHECK: %v = load i32, i32* %p, align 4 ; (mustexec in: inner_loop) ; CHECK: %v = load i32, ptr %p, align 4 ; (mustexec in: inner_loop)
; CHECK: %inner.test = icmp eq i32 %v, 0 ; (mustexec in: inner_loop) ; CHECK: %inner.test = icmp eq i32 %v, 0 ; (mustexec in: inner_loop)
; CHECK: br i1 %inner.test, label %inner_loop, label %next ; (mustexec in: inner_loop) ; CHECK: br i1 %inner.test, label %inner_loop, label %next ; (mustexec in: inner_loop)
; CHECK-NOT: mustexec ; CHECK-NOT: mustexec
@ -69,7 +69,7 @@ loop:
br label %inner_loop br label %inner_loop
inner_loop: inner_loop:
%v = load i32, i32* %p %v = load i32, ptr %p
%inner.test = icmp eq i32 %v, 0 %inner.test = icmp eq i32 %v, 0
br i1 %inner.test, label %inner_loop, label %next br i1 %inner.test, label %inner_loop, label %next
@ -83,13 +83,13 @@ exit:
ret i1 false ret i1 false
} }
define i1 @nested_no_throw(i32* noalias %p, i32 %high) { define i1 @nested_no_throw(ptr noalias %p, i32 %high) {
; CHECK-LABEL: @nested_no_throw ; CHECK-LABEL: @nested_no_throw
; CHECK-LABEL: loop: ; preds = %next ; CHECK-LABEL: loop: ; preds = %next
; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %next ] ; (mustexec in: loop) ; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %next ] ; (mustexec in: loop)
; CHECK: br label %inner_loop ; (mustexec in: loop) ; CHECK: br label %inner_loop ; (mustexec in: loop)
; CHECK-LABEL: inner_loop: ; CHECK-LABEL: inner_loop:
; CHECK: %v = load i32, i32* %p, align 4 ; (mustexec in 2 loops: inner_loop, loop) ; CHECK: %v = load i32, ptr %p, align 4 ; (mustexec in 2 loops: inner_loop, loop)
; CHECK: %inner.test = icmp eq i32 %v, 0 ; (mustexec in 2 loops: inner_loop, loop) ; CHECK: %inner.test = icmp eq i32 %v, 0 ; (mustexec in 2 loops: inner_loop, loop)
; CHECK: br i1 %inner.test, label %inner_loop, label %next ; (mustexec in 2 loops: inner_loop, loop) ; CHECK: br i1 %inner.test, label %inner_loop, label %next ; (mustexec in 2 loops: inner_loop, loop)
; CHECK-LABEL: next: ; CHECK-LABEL: next:
@ -105,7 +105,7 @@ loop:
br label %inner_loop br label %inner_loop
inner_loop: inner_loop:
%v = load i32, i32* %p %v = load i32, ptr %p
%inner.test = icmp eq i32 %v, 0 %inner.test = icmp eq i32 %v, 0
br i1 %inner.test, label %inner_loop, label %next br i1 %inner.test, label %inner_loop, label %next
@ -121,13 +121,13 @@ exit:
; Since all the instructions in the loop dominate the only exit ; Since all the instructions in the loop dominate the only exit
; and there's no implicit control flow in the loop, all must execute ; and there's no implicit control flow in the loop, all must execute
; FIXME: handled by loop safety info, test it ; FIXME: handled by loop safety info, test it
define i1 @nothrow_loop(i32* noalias %p, i32 %high) { define i1 @nothrow_loop(ptr noalias %p, i32 %high) {
; CHECK-LABEL: @nothrow_loop( ; CHECK-LABEL: @nothrow_loop(
; CHECK-LABEL: loop: ; CHECK-LABEL: loop:
; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %next ] ; (mustexec in: loop) ; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %next ] ; (mustexec in: loop)
; CHECK: br label %next ; (mustexec in: loop) ; CHECK: br label %next ; (mustexec in: loop)
; CHECK-LABEL: next: ; CHECK-LABEL: next:
; CHECK: %v = load i32, i32* %p, align 4 ; (mustexec in: loop) ; CHECK: %v = load i32, ptr %p, align 4 ; (mustexec in: loop)
; CHECK: %iv.next = add nuw nsw i32 %iv, 1 ; (mustexec in: loop) ; CHECK: %iv.next = add nuw nsw i32 %iv, 1 ; (mustexec in: loop)
; CHECK: %exit.test = icmp slt i32 %iv, %high ; (mustexec in: loop) ; CHECK: %exit.test = icmp slt i32 %iv, %high ; (mustexec in: loop)
; CHECK: br i1 %exit.test, label %exit, label %loop ; (mustexec in: loop) ; CHECK: br i1 %exit.test, label %exit, label %loop ; (mustexec in: loop)
@ -140,7 +140,7 @@ loop:
%iv = phi i32 [0, %entry], [%iv.next, %next] %iv = phi i32 [0, %entry], [%iv.next, %next]
br label %next br label %next
next: next:
%v = load i32, i32* %p %v = load i32, ptr %p
%iv.next = add nsw nuw i32 %iv, 1 %iv.next = add nsw nuw i32 %iv, 1
%exit.test = icmp slt i32 %iv, %high %exit.test = icmp slt i32 %iv, %high
br i1 %exit.test, label %exit, label %loop br i1 %exit.test, label %exit, label %loop

View File

@ -386,37 +386,37 @@ declare void @F() nounwind
declare void @G() nounwind willreturn declare void @G() nounwind willreturn
declare i32 @g(i32*) nounwind willreturn declare i32 @g(ptr) nounwind willreturn
declare void @h(i32*) nounwind willreturn declare void @h(ptr) nounwind willreturn
define i32 @nonnull_exec_ctx_1(i32* %a, i32 %b) { define i32 @nonnull_exec_ctx_1(ptr %a, i32 %b) {
; MBEC: -- Explore context of: %tmp3 = icmp eq i32 %b, 0 ; MBEC: -- Explore context of: %tmp3 = icmp eq i32 %b, 0
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: -- Explore context of: br i1 %tmp3, label %ex, label %hd ; MBEC-NEXT: -- Explore context of: br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
; MBEC-NEXT: -- Explore context of: %tmp5 = tail call i32 @g(i32* nonnull %a) ; MBEC-NEXT: -- Explore context of: %tmp5 = tail call i32 @g(ptr nonnull %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp5 = tail call i32 @g(i32* nonnull %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp5 = tail call i32 @g(ptr nonnull %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_1] ret i32 %tmp5 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] ret i32 %tmp5
; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
; MBEC-NEXT: -- Explore context of: ret i32 %tmp5 ; MBEC-NEXT: -- Explore context of: ret i32 %tmp5
; MBEC-NEXT: [F: nonnull_exec_ctx_1] ret i32 %tmp5 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] ret i32 %tmp5
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp5 = tail call i32 @g(i32* nonnull %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp5 = tail call i32 @g(ptr nonnull %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
; MBEC-NEXT: -- Explore context of: %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ] ; MBEC-NEXT: -- Explore context of: %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ] ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(i32* %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(ptr %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b
; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
; MBEC-NEXT: -- Explore context of: tail call void @h(i32* %a) ; MBEC-NEXT: -- Explore context of: tail call void @h(ptr %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(i32* %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(ptr %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b
; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd
@ -427,7 +427,7 @@ define i32 @nonnull_exec_ctx_1(i32* %a, i32 %b) {
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b
; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(i32* %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(ptr %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ] ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
@ -435,7 +435,7 @@ define i32 @nonnull_exec_ctx_1(i32* %a, i32 %b) {
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b
; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1
; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(i32* %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(ptr %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ] ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
@ -443,7 +443,7 @@ define i32 @nonnull_exec_ctx_1(i32* %a, i32 %b) {
; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1
; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(i32* %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(ptr %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ] ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
@ -452,54 +452,54 @@ en:
br i1 %tmp3, label %ex, label %hd br i1 %tmp3, label %ex, label %hd
ex: ex:
%tmp5 = tail call i32 @g(i32* nonnull %a) %tmp5 = tail call i32 @g(ptr nonnull %a)
ret i32 %tmp5 ret i32 %tmp5
hd: hd:
%tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
tail call void @h(i32* %a) tail call void @h(ptr %a)
%tmp8 = add nuw i32 %tmp7, 1 %tmp8 = add nuw i32 %tmp7, 1
%tmp9 = icmp eq i32 %tmp8, %b %tmp9 = icmp eq i32 %tmp8, %b
br i1 %tmp9, label %ex, label %hd br i1 %tmp9, label %ex, label %hd
} }
define i32 @nonnull_exec_ctx_2(i32* %a, i32 %b) nounwind willreturn { define i32 @nonnull_exec_ctx_2(ptr %a, i32 %b) nounwind willreturn {
; MBEC: -- Explore context of: %tmp3 = icmp eq i32 %b, 0 ; MBEC: -- Explore context of: %tmp3 = icmp eq i32 %b, 0
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(i32* nonnull %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(ptr nonnull %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
; MBEC-NEXT: -- Explore context of: br i1 %tmp3, label %ex, label %hd ; MBEC-NEXT: -- Explore context of: br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(i32* nonnull %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(ptr nonnull %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
; MBEC-NEXT: -- Explore context of: %tmp5 = tail call i32 @g(i32* nonnull %a) ; MBEC-NEXT: -- Explore context of: %tmp5 = tail call i32 @g(ptr nonnull %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(i32* nonnull %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(ptr nonnull %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
; MBEC-NEXT: -- Explore context of: ret i32 %tmp5 ; MBEC-NEXT: -- Explore context of: ret i32 %tmp5
; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(i32* nonnull %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(ptr nonnull %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
; MBEC-NEXT: -- Explore context of: %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ] ; MBEC-NEXT: -- Explore context of: %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ] ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(i32* %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(ptr %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b
; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(i32* nonnull %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(ptr nonnull %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
; MBEC-NEXT: -- Explore context of: tail call void @h(i32* %a) ; MBEC-NEXT: -- Explore context of: tail call void @h(ptr %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(i32* %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(ptr %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b
; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(i32* nonnull %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(ptr nonnull %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ] ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
@ -508,29 +508,29 @@ define i32 @nonnull_exec_ctx_2(i32* %a, i32 %b) nounwind willreturn {
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b
; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(i32* nonnull %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(ptr nonnull %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(i32* %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(ptr %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ] ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
; MBEC-NEXT: -- Explore context of: %tmp9 = icmp eq i32 %tmp8, %b ; MBEC-NEXT: -- Explore context of: %tmp9 = icmp eq i32 %tmp8, %b
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b
; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(i32* nonnull %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(ptr nonnull %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1
; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(i32* %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(ptr %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ] ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
; MBEC-NEXT: -- Explore context of: br i1 %tmp9, label %ex, label %hd ; MBEC-NEXT: -- Explore context of: br i1 %tmp9, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(i32* nonnull %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(ptr nonnull %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1
; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(i32* %a) ; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(ptr %a)
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ] ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
@ -539,12 +539,12 @@ en:
br i1 %tmp3, label %ex, label %hd br i1 %tmp3, label %ex, label %hd
ex: ex:
%tmp5 = tail call i32 @g(i32* nonnull %a) %tmp5 = tail call i32 @g(ptr nonnull %a)
ret i32 %tmp5 ret i32 %tmp5
hd: hd:
%tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
tail call void @h(i32* %a) tail call void @h(ptr %a)
%tmp8 = add nuw i32 %tmp7, 1 %tmp8 = add nuw i32 %tmp7, 1
%tmp9 = icmp eq i32 %tmp8, %b %tmp9 = icmp eq i32 %tmp8, %b
br i1 %tmp9, label %ex, label %hd br i1 %tmp9, label %ex, label %hd

View File

@ -3,7 +3,7 @@
@X = common global i32 0 @X = common global i32 0
; CHECK-LABEL: PHI Values for function: simple ; CHECK-LABEL: PHI Values for function: simple
define void @simple(i32* %ptr) { define void @simple(ptr %ptr) {
entry: entry:
br i1 undef, label %if, label %else br i1 undef, label %if, label %else
@ -21,7 +21,7 @@ end:
; CHECK: PHI %phi2 has values: ; CHECK: PHI %phi2 has values:
; CHECK-DAG: @X ; CHECK-DAG: @X
; CHECK-DAG: %ptr ; CHECK-DAG: %ptr
%phi2 = phi i32* [ @X, %if ], [ %ptr, %else ] %phi2 = phi ptr [ @X, %if ], [ %ptr, %else ]
ret void ret void
} }

View File

@ -5,15 +5,15 @@
; analysis doesn't repeatedly add a phis values to itself until it segfaults. ; analysis doesn't repeatedly add a phis values to itself until it segfaults.
; CHECK-LABEL: PHI Values for function: fn ; CHECK-LABEL: PHI Values for function: fn
define void @fn(i8* %arg) { define void @fn(ptr %arg) {
entry: entry:
br label %for.body br label %for.body
for.body: for.body:
; CHECK: PHI %phi1 has values: ; CHECK: PHI %phi1 has values:
; CHECK-DAG: i8* %arg ; CHECK-DAG: ptr %arg
; CHECK-DAG: i8* undef ; CHECK-DAG: ptr undef
%phi1 = phi i8* [ %arg, %entry ], [ %phi2, %end ] %phi1 = phi ptr [ %arg, %entry ], [ %phi2, %end ]
switch i32 undef, label %end [ switch i32 undef, label %end [
i32 1, label %bb1 i32 1, label %bb1
i32 2, label %bb2 i32 2, label %bb2
@ -71,8 +71,8 @@ bb13:
end: end:
; CHECK: PHI %phi2 has values: ; CHECK: PHI %phi2 has values:
; CHECK-DAG: i8* %arg ; CHECK-DAG: ptr %arg
; CHECK-DAG: i8* undef ; CHECK-DAG: ptr undef
%phi2 = phi i8* [ %phi1, %for.body ], [ %phi1, %bb1 ], [ %phi1, %bb2 ], [ %phi1, %bb3 ], [ %phi1, %bb4 ], [ %phi1, %bb5 ], [ %phi1, %bb6 ], [ %phi1, %bb7 ], [ undef, %bb8 ], [ %phi1, %bb9 ], [ %phi1, %bb10 ], [ %phi1, %bb11 ], [ %phi1, %bb12 ], [ %phi1, %bb13 ] %phi2 = phi ptr [ %phi1, %for.body ], [ %phi1, %bb1 ], [ %phi1, %bb2 ], [ %phi1, %bb3 ], [ %phi1, %bb4 ], [ %phi1, %bb5 ], [ %phi1, %bb6 ], [ %phi1, %bb7 ], [ undef, %bb8 ], [ %phi1, %bb9 ], [ %phi1, %bb10 ], [ %phi1, %bb11 ], [ %phi1, %bb12 ], [ %phi1, %bb13 ]
br label %for.body br label %for.body
} }

View File

@ -4,14 +4,14 @@
; phi values analysis to segfault if it's not careful about that kind of thing. ; phi values analysis to segfault if it's not careful about that kind of thing.
; CHECK-LABEL: PHI Values for function: fn ; CHECK-LABEL: PHI Values for function: fn
define void @fn(i32* %arg) { define void @fn(ptr %arg) {
entry: entry:
br label %while1.cond br label %while1.cond
while1.cond: while1.cond:
; CHECK: PHI %phi1 has values: ; CHECK: PHI %phi1 has values:
; CHECK: i32* %arg ; CHECK: ptr %arg
%phi1 = phi i32* [ %arg, %entry ], [ %phi2, %while1.then ] %phi1 = phi ptr [ %arg, %entry ], [ %phi2, %while1.then ]
br i1 undef, label %while1.end, label %while1.body br i1 undef, label %while1.end, label %while1.body
while1.body: while1.body:
@ -22,8 +22,8 @@ while1.if:
while1.then: while1.then:
; CHECK: PHI %phi2 has values: ; CHECK: PHI %phi2 has values:
; CHECK: i32* %arg ; CHECK: ptr %arg
%phi2 = phi i32* [ %arg, %while1.if ], [ %phi1, %while1.body ] %phi2 = phi ptr [ %arg, %while1.if ], [ %phi1, %while1.body ]
br label %while1.cond br label %while1.cond
while1.end: while1.end:
@ -31,8 +31,8 @@ while1.end:
while2.cond1: while2.cond1:
; CHECK: PHI %phi3 has values: ; CHECK: PHI %phi3 has values:
; CHECK: i32* %arg ; CHECK: ptr %arg
%phi3 = phi i32* [ %phi1, %while1.end ], [ %phi5, %while2.then ] %phi3 = phi ptr [ %phi1, %while1.end ], [ %phi5, %while2.then ]
br i1 undef, label %while2.end, label %while2.body1 br i1 undef, label %while2.end, label %while2.body1
while2.body1: while2.body1:
@ -40,8 +40,8 @@ while2.body1:
while2.cond2: while2.cond2:
; CHECK: PHI %phi4 has values: ; CHECK: PHI %phi4 has values:
; CHECK: i32* %arg ; CHECK: ptr %arg
%phi4 = phi i32* [ %phi3, %while2.body1 ], [ %phi4, %while2.if ] %phi4 = phi ptr [ %phi3, %while2.body1 ], [ %phi4, %while2.if ]
br i1 undef, label %while2.then, label %while2.if br i1 undef, label %while2.then, label %while2.if
while2.if: while2.if:
@ -49,8 +49,8 @@ while2.if:
while2.then: while2.then:
; CHECK: PHI %phi5 has values: ; CHECK: PHI %phi5 has values:
; CHECK: i32* %arg ; CHECK: ptr %arg
%phi5 = phi i32* [ %phi3, %while2.body1 ], [ %phi4, %while2.cond2 ] %phi5 = phi ptr [ %phi3, %while2.body1 ], [ %phi4, %while2.cond2 ]
br label %while2.cond1 br label %while2.cond1
while2.end: while2.end:
@ -58,14 +58,14 @@ while2.end:
while3.cond1: while3.cond1:
; CHECK: PHI %phi6 has values: ; CHECK: PHI %phi6 has values:
; CHECK: i32* %arg ; CHECK: ptr %arg
%phi6 = phi i32* [ %phi3, %while2.end ], [ %phi7, %while3.cond2 ] %phi6 = phi ptr [ %phi3, %while2.end ], [ %phi7, %while3.cond2 ]
br i1 undef, label %while3.end, label %while3.cond2 br i1 undef, label %while3.end, label %while3.cond2
while3.cond2: while3.cond2:
; CHECK: PHI %phi7 has values: ; CHECK: PHI %phi7 has values:
; CHECK: i32* %arg ; CHECK: ptr %arg
%phi7 = phi i32* [ %phi6, %while3.cond1 ], [ %phi7, %while3.body ] %phi7 = phi ptr [ %phi6, %while3.cond1 ], [ %phi7, %while3.body ]
br i1 undef, label %while3.cond1, label %while3.body br i1 undef, label %while3.cond1, label %while3.body
while3.body: while3.body:
@ -76,8 +76,8 @@ while3.end:
while4.cond1: while4.cond1:
; CHECK: PHI %phi8 has values: ; CHECK: PHI %phi8 has values:
; CHECK: i32* %arg ; CHECK: ptr %arg
%phi8 = phi i32* [ %phi6, %while3.end ], [ %phi10, %while4.then ] %phi8 = phi ptr [ %phi6, %while3.end ], [ %phi10, %while4.then ]
br i1 undef, label %while4.end, label %while4.if br i1 undef, label %while4.end, label %while4.if
while4.if: while4.if:
@ -85,8 +85,8 @@ while4.if:
while4.cond2: while4.cond2:
; CHECK: PHI %phi9 has values: ; CHECK: PHI %phi9 has values:
; CHECK: i32* %arg ; CHECK: ptr %arg
%phi9 = phi i32* [ %phi8, %while4.if ], [ %phi9, %while4.body ] %phi9 = phi ptr [ %phi8, %while4.if ], [ %phi9, %while4.body ]
br i1 undef, label %while4.then, label %while4.body br i1 undef, label %while4.then, label %while4.body
while4.body: while4.body:
@ -94,8 +94,8 @@ while4.body:
while4.then: while4.then:
; CHECK: PHI %phi10 has values: ; CHECK: PHI %phi10 has values:
; CHECK: i32* %arg ; CHECK: ptr %arg
%phi10 = phi i32* [ %phi8, %while4.if ], [ %phi9, %while4.cond2 ] %phi10 = phi ptr [ %phi8, %while4.if ], [ %phi9, %while4.cond2 ]
br label %while4.cond1 br label %while4.cond1
while4.end: while4.end:
@ -103,8 +103,8 @@ while4.end:
while5.cond: while5.cond:
; CHECK: PHI %phi11 has values: ; CHECK: PHI %phi11 has values:
; CHECK: i32* %arg ; CHECK: ptr %arg
%phi11 = phi i32* [ %phi8, %while4.end ], [ %phi13, %while5.then ] %phi11 = phi ptr [ %phi8, %while4.end ], [ %phi13, %while5.then ]
br i1 undef, label %while5.end, label %while5.body1 br i1 undef, label %while5.end, label %while5.body1
while5.body1: while5.body1:
@ -112,8 +112,8 @@ while5.body1:
while5.if: while5.if:
; CHECK: PHI %phi12 has values: ; CHECK: PHI %phi12 has values:
; CHECK: i32* %arg ; CHECK: ptr %arg
%phi12 = phi i32* [ %phi11, %while5.body1 ], [ %phi12, %while5.body2 ] %phi12 = phi ptr [ %phi11, %while5.body1 ], [ %phi12, %while5.body2 ]
br i1 undef, label %while5.then, label %while5.body2 br i1 undef, label %while5.then, label %while5.body2
while5.body2: while5.body2:
@ -121,8 +121,8 @@ while5.body2:
while5.then: while5.then:
; CHECK: PHI %phi13 has values: ; CHECK: PHI %phi13 has values:
; CHECK: i32* %arg ; CHECK: ptr %arg
%phi13 = phi i32* [ %phi11, %while5.body1 ], [ %phi12, %while5.if ] %phi13 = phi ptr [ %phi11, %while5.body1 ], [ %phi12, %while5.if ]
br label %while5.cond br label %while5.cond
while5.end: while5.end:
@ -130,13 +130,13 @@ while5.end:
while6.cond1: while6.cond1:
; CHECK: PHI %phi14 has values: ; CHECK: PHI %phi14 has values:
; CHECK: i32* %arg ; CHECK: ptr %arg
%phi14 = phi i32* [ %phi11, %while5.end ], [ %phi14, %while6.cond1 ] %phi14 = phi ptr [ %phi11, %while5.end ], [ %phi14, %while6.cond1 ]
br i1 undef, label %while6.cond2, label %while6.cond1 br i1 undef, label %while6.cond2, label %while6.cond1
while6.cond2: while6.cond2:
; CHECK: PHI %phi15 has values: ; CHECK: PHI %phi15 has values:
; CHECK: i32* %arg ; CHECK: ptr %arg
%phi15 = phi i32* [ %phi14, %while6.cond1 ], [ %phi15, %while6.cond2 ] %phi15 = phi ptr [ %phi14, %while6.cond1 ], [ %phi15, %while6.cond2 ]
br label %while6.cond2 br label %while6.cond2
} }

View File

@ -4,7 +4,7 @@
define void @fn1() { define void @fn1() {
entry: entry:
store i32 5, i32* @a, align 4 store i32 5, ptr @a, align 4
%call = call i32 (...) @foo() %call = call i32 (...) @foo()
%tobool = icmp ne i32 %call, 0 %tobool = icmp ne i32 %call, 0
br i1 %tobool, label %if.then, label %if.end br i1 %tobool, label %if.then, label %if.end
@ -16,7 +16,7 @@ loop: ; preds = %loop, %if.then
br label %loop br label %loop
if.end: ; preds = %entry if.end: ; preds = %entry
store i32 6, i32* @a, align 4 store i32 6, ptr @a, align 4
ret void ret void
} }

View File

@ -4,7 +4,7 @@
define void @fn1() { define void @fn1() {
entry: entry:
store i32 5, i32* @a, align 4 store i32 5, ptr @a, align 4
%call = call i32 (...) @foo() %call = call i32 (...) @foo()
%tobool = icmp ne i32 %call, 0 %tobool = icmp ne i32 %call, 0
br i1 %tobool, label %if.then, label %if.end br i1 %tobool, label %if.then, label %if.end
@ -13,12 +13,12 @@ if.then: ; preds = %entry
br label %loop br label %loop
loop: ; preds = %loop, %if.then loop: ; preds = %loop, %if.then
%0 = load i32, i32* @a, align 4 %0 = load i32, ptr @a, align 4
call void @bar(i32 %0) call void @bar(i32 %0)
br label %loop br label %loop
if.end: ; preds = %entry if.end: ; preds = %entry
store i32 6, i32* @a, align 4 store i32 6, ptr @a, align 4
ret void ret void
} }

View File

@ -4,7 +4,7 @@
define void @fn1() { define void @fn1() {
entry: entry:
store i32 5, i32* @a, align 4 store i32 5, ptr @a, align 4
%call = call i32 (...) @foo() %call = call i32 (...) @foo()
%tobool = icmp ne i32 %call, 0 %tobool = icmp ne i32 %call, 0
br i1 %tobool, label %if.then, label %if.end br i1 %tobool, label %if.then, label %if.end
@ -13,12 +13,12 @@ if.then: ; preds = %entry, %loop
br label %loop br label %loop
loop: ; preds = %loop, %if.then loop: ; preds = %loop, %if.then
%0 = load i32, i32* @a, align 4 %0 = load i32, ptr @a, align 4
call void @bar(i32 %0) call void @bar(i32 %0)
br i1 true, label %loop, label %if.then br i1 true, label %loop, label %if.then
if.end: ; preds = %entry if.end: ; preds = %entry
store i32 6, i32* @a, align 4 store i32 6, ptr @a, align 4
ret void ret void
} }

View File

@ -5,13 +5,13 @@ define i8 @test(i8 %input) {
%tmp = alloca i8 %tmp = alloca i8
%dst = alloca i8 %dst = alloca i8
%src = alloca i8 %src = alloca i8
; CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %dst, i8* align 8 %src, i64 1, i1 false), !alias.scope ![[SCOPE:[0-9]+]] ; CHECK: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %dst, ptr align 8 %src, i64 1, i1 false), !alias.scope ![[SCOPE:[0-9]+]]
call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull %src), !noalias !4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %src), !noalias !4
store i8 %input, i8* %src store i8 %input, ptr %src
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %tmp, i8* align 8 %src, i64 1, i1 false), !alias.scope !0 call void @llvm.memcpy.p0.p0.i64(ptr align 8 %tmp, ptr align 8 %src, i64 1, i1 false), !alias.scope !0
call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %src), !noalias !4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %src), !noalias !4
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %dst, i8* align 8 %tmp, i64 1, i1 false), !alias.scope !4 call void @llvm.memcpy.p0.p0.i64(ptr align 8 %dst, ptr align 8 %tmp, i64 1, i1 false), !alias.scope !4
%ret_value = load i8, i8* %dst %ret_value = load i8, ptr %dst
ret i8 %ret_value ret i8 %ret_value
} }
@ -20,9 +20,9 @@ define i8 @test(i8 %input) {
; CHECK-DAG: ![[CALLEE0_B:[0-9]+]] = distinct !{!{{[0-9]+}}, !{{[0-9]+}}, !"callee0: %b"} ; CHECK-DAG: ![[CALLEE0_B:[0-9]+]] = distinct !{!{{[0-9]+}}, !{{[0-9]+}}, !"callee0: %b"}
; CHECK-DAG: ![[SCOPE]] = !{![[CALLEE0_A]], ![[CALLEE0_B]]} ; CHECK-DAG: ![[SCOPE]] = !{![[CALLEE0_A]], ![[CALLEE0_B]]}
declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) declare void @llvm.lifetime.start.p0(i64, ptr nocapture)
declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i1) declare void @llvm.memcpy.p0.p0.i64(ptr, ptr, i64, i1)
!0 = !{!1, !7} !0 = !{!1, !7}
!1 = distinct !{!1, !3, !"callee0: %a"} !1 = distinct !{!1, !3, !"callee0: %a"}

View File

@ -2,20 +2,20 @@
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu" target triple = "x86_64-unknown-linux-gnu"
define void @foo1(float* nocapture %a, float* nocapture readonly %c) #0 { define void @foo1(ptr nocapture %a, ptr nocapture readonly %c) #0 {
entry: entry:
; CHECK-LABEL: Function: foo1 ; CHECK-LABEL: Function: foo1
%0 = load float, float* %c, align 4, !alias.scope !0 %0 = load float, ptr %c, align 4, !alias.scope !0
%arrayidx.i = getelementptr inbounds float, float* %a, i64 5 %arrayidx.i = getelementptr inbounds float, ptr %a, i64 5
store float %0, float* %arrayidx.i, align 4, !noalias !6 store float %0, ptr %arrayidx.i, align 4, !noalias !6
%1 = load float, float* %c, align 4, !alias.scope !7 %1 = load float, ptr %c, align 4, !alias.scope !7
%arrayidx.i2 = getelementptr inbounds float, float* %a, i64 15 %arrayidx.i2 = getelementptr inbounds float, ptr %a, i64 15
store float %1, float* %arrayidx.i2, align 4, !noalias !6 store float %1, ptr %arrayidx.i2, align 4, !noalias !6
%2 = load float, float* %c, align 4, !alias.scope !6 %2 = load float, ptr %c, align 4, !alias.scope !6
%arrayidx.i3 = getelementptr inbounds float, float* %a, i64 16 %arrayidx.i3 = getelementptr inbounds float, ptr %a, i64 16
store float %2, float* %arrayidx.i3, align 4, !noalias !7 store float %2, ptr %arrayidx.i3, align 4, !noalias !7
ret void ret void
} }
@ -40,16 +40,16 @@ attributes #0 = { nounwind uwtable }
; A list of scopes from both domains. ; A list of scopes from both domains.
!0 = !{!1, !3, !4} !0 = !{!1, !3, !4}
; CHECK: NoAlias: %0 = load float, float* %c, align 4, !alias.scope !0 <-> store float %0, float* %arrayidx.i, align 4, !noalias !6 ; CHECK: NoAlias: %0 = load float, ptr %c, align 4, !alias.scope !0 <-> store float %0, ptr %arrayidx.i, align 4, !noalias !6
; CHECK: NoAlias: %0 = load float, float* %c, align 4, !alias.scope !0 <-> store float %1, float* %arrayidx.i2, align 4, !noalias !6 ; CHECK: NoAlias: %0 = load float, ptr %c, align 4, !alias.scope !0 <-> store float %1, ptr %arrayidx.i2, align 4, !noalias !6
; CHECK: MayAlias: %0 = load float, float* %c, align 4, !alias.scope !0 <-> store float %2, float* %arrayidx.i3, align 4, !noalias !7 ; CHECK: MayAlias: %0 = load float, ptr %c, align 4, !alias.scope !0 <-> store float %2, ptr %arrayidx.i3, align 4, !noalias !7
; CHECK: NoAlias: %1 = load float, float* %c, align 4, !alias.scope !7 <-> store float %0, float* %arrayidx.i, align 4, !noalias !6 ; CHECK: NoAlias: %1 = load float, ptr %c, align 4, !alias.scope !7 <-> store float %0, ptr %arrayidx.i, align 4, !noalias !6
; CHECK: NoAlias: %1 = load float, float* %c, align 4, !alias.scope !7 <-> store float %1, float* %arrayidx.i2, align 4, !noalias !6 ; CHECK: NoAlias: %1 = load float, ptr %c, align 4, !alias.scope !7 <-> store float %1, ptr %arrayidx.i2, align 4, !noalias !6
; CHECK: NoAlias: %1 = load float, float* %c, align 4, !alias.scope !7 <-> store float %2, float* %arrayidx.i3, align 4, !noalias !7 ; CHECK: NoAlias: %1 = load float, ptr %c, align 4, !alias.scope !7 <-> store float %2, ptr %arrayidx.i3, align 4, !noalias !7
; CHECK: NoAlias: %2 = load float, float* %c, align 4, !alias.scope !6 <-> store float %0, float* %arrayidx.i, align 4, !noalias !6 ; CHECK: NoAlias: %2 = load float, ptr %c, align 4, !alias.scope !6 <-> store float %0, ptr %arrayidx.i, align 4, !noalias !6
; CHECK: NoAlias: %2 = load float, float* %c, align 4, !alias.scope !6 <-> store float %1, float* %arrayidx.i2, align 4, !noalias !6 ; CHECK: NoAlias: %2 = load float, ptr %c, align 4, !alias.scope !6 <-> store float %1, ptr %arrayidx.i2, align 4, !noalias !6
; CHECK: MayAlias: %2 = load float, float* %c, align 4, !alias.scope !6 <-> store float %2, float* %arrayidx.i3, align 4, !noalias !7 ; CHECK: MayAlias: %2 = load float, ptr %c, align 4, !alias.scope !6 <-> store float %2, ptr %arrayidx.i3, align 4, !noalias !7
; CHECK: NoAlias: store float %1, float* %arrayidx.i2, align 4, !noalias !6 <-> store float %0, float* %arrayidx.i, align 4, !noalias !6 ; CHECK: NoAlias: store float %1, ptr %arrayidx.i2, align 4, !noalias !6 <-> store float %0, ptr %arrayidx.i, align 4, !noalias !6
; CHECK: NoAlias: store float %2, float* %arrayidx.i3, align 4, !noalias !7 <-> store float %0, float* %arrayidx.i, align 4, !noalias !6 ; CHECK: NoAlias: store float %2, ptr %arrayidx.i3, align 4, !noalias !7 <-> store float %0, ptr %arrayidx.i, align 4, !noalias !6
; CHECK: NoAlias: store float %2, float* %arrayidx.i3, align 4, !noalias !7 <-> store float %1, float* %arrayidx.i2, align 4, !noalias !6 ; CHECK: NoAlias: store float %2, ptr %arrayidx.i3, align 4, !noalias !7 <-> store float %1, ptr %arrayidx.i2, align 4, !noalias !6

View File

@ -2,22 +2,22 @@
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu" target triple = "x86_64-unknown-linux-gnu"
define void @foo1(float* nocapture %a, float* nocapture readonly %c) #0 { define void @foo1(ptr nocapture %a, ptr nocapture readonly %c) #0 {
entry: entry:
; CHECK-LABEL: Function: foo1 ; CHECK-LABEL: Function: foo1
%0 = load float, float* %c, align 4, !alias.scope !2 %0 = load float, ptr %c, align 4, !alias.scope !2
%arrayidx.i = getelementptr inbounds float, float* %a, i64 5 %arrayidx.i = getelementptr inbounds float, ptr %a, i64 5
store float %0, float* %arrayidx.i, align 4, !noalias !2 store float %0, ptr %arrayidx.i, align 4, !noalias !2
%1 = load float, float* %c, align 4 %1 = load float, ptr %c, align 4
%arrayidx = getelementptr inbounds float, float* %a, i64 7 %arrayidx = getelementptr inbounds float, ptr %a, i64 7
store float %1, float* %arrayidx, align 4 store float %1, ptr %arrayidx, align 4
ret void ret void
; CHECK: NoAlias: %0 = load float, float* %c, align 4, !alias.scope !0 <-> store float %0, float* %arrayidx.i, align 4, !noalias !0 ; CHECK: NoAlias: %0 = load float, ptr %c, align 4, !alias.scope !0 <-> store float %0, ptr %arrayidx.i, align 4, !noalias !0
; CHECK: MayAlias: %0 = load float, float* %c, align 4, !alias.scope !0 <-> store float %1, float* %arrayidx, align 4 ; CHECK: MayAlias: %0 = load float, ptr %c, align 4, !alias.scope !0 <-> store float %1, ptr %arrayidx, align 4
; CHECK: MayAlias: %1 = load float, float* %c, align 4 <-> store float %0, float* %arrayidx.i, align 4, !noalias !0 ; CHECK: MayAlias: %1 = load float, ptr %c, align 4 <-> store float %0, ptr %arrayidx.i, align 4, !noalias !0
; CHECK: MayAlias: %1 = load float, float* %c, align 4 <-> store float %1, float* %arrayidx, align 4 ; CHECK: MayAlias: %1 = load float, ptr %c, align 4 <-> store float %1, ptr %arrayidx, align 4
; CHECK: NoAlias: store float %1, float* %arrayidx, align 4 <-> store float %0, float* %arrayidx.i, align 4, !noalias !0 ; CHECK: NoAlias: store float %1, ptr %arrayidx, align 4 <-> store float %0, ptr %arrayidx.i, align 4, !noalias !0
} }
attributes #0 = { nounwind uwtable } attributes #0 = { nounwind uwtable }

View File

@ -2,31 +2,31 @@
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu" target triple = "x86_64-unknown-linux-gnu"
define void @foo2(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 { define void @foo2(ptr nocapture %a, ptr nocapture %b, ptr nocapture readonly %c) #0 {
entry: entry:
; CHECK-LABEL: Function: foo2 ; CHECK-LABEL: Function: foo2
%0 = load float, float* %c, align 4, !alias.scope !0 %0 = load float, ptr %c, align 4, !alias.scope !0
%arrayidx.i = getelementptr inbounds float, float* %a, i64 5 %arrayidx.i = getelementptr inbounds float, ptr %a, i64 5
store float %0, float* %arrayidx.i, align 4, !alias.scope !5, !noalias !4 store float %0, ptr %arrayidx.i, align 4, !alias.scope !5, !noalias !4
%arrayidx1.i = getelementptr inbounds float, float* %b, i64 8 %arrayidx1.i = getelementptr inbounds float, ptr %b, i64 8
store float %0, float* %arrayidx1.i, align 4, !alias.scope !0, !noalias !5 store float %0, ptr %arrayidx1.i, align 4, !alias.scope !0, !noalias !5
%1 = load float, float* %c, align 4 %1 = load float, ptr %c, align 4
%arrayidx = getelementptr inbounds float, float* %a, i64 7 %arrayidx = getelementptr inbounds float, ptr %a, i64 7
store float %1, float* %arrayidx, align 4 store float %1, ptr %arrayidx, align 4
ret void ret void
; CHECK: MayAlias: %0 = load float, float* %c, align 4, !alias.scope !0 <-> store float %0, float* %arrayidx.i, align 4, !alias.scope !4, !noalia ; CHECK: MayAlias: %0 = load float, ptr %c, align 4, !alias.scope !0 <-> store float %0, ptr %arrayidx.i, align 4, !alias.scope !4, !noalia
; CHECK: s !5 ; CHECK: s !5
; CHECK: MayAlias: %0 = load float, float* %c, align 4, !alias.scope !0 <-> store float %0, float* %arrayidx1.i, align 4, !alias.scope !0, !noali ; CHECK: MayAlias: %0 = load float, ptr %c, align 4, !alias.scope !0 <-> store float %0, ptr %arrayidx1.i, align 4, !alias.scope !0, !noali
; CHECK: as !4 ; CHECK: as !4
; CHECK: MayAlias: %0 = load float, float* %c, align 4, !alias.scope !0 <-> store float %1, float* %arrayidx, align 4 ; CHECK: MayAlias: %0 = load float, ptr %c, align 4, !alias.scope !0 <-> store float %1, ptr %arrayidx, align 4
; CHECK: MayAlias: %1 = load float, float* %c, align 4 <-> store float %0, float* %arrayidx.i, align 4, !alias.scope !4, !noalias !5 ; CHECK: MayAlias: %1 = load float, ptr %c, align 4 <-> store float %0, ptr %arrayidx.i, align 4, !alias.scope !4, !noalias !5
; CHECK: MayAlias: %1 = load float, float* %c, align 4 <-> store float %0, float* %arrayidx1.i, align 4, !alias.scope !0, !noalias !4 ; CHECK: MayAlias: %1 = load float, ptr %c, align 4 <-> store float %0, ptr %arrayidx1.i, align 4, !alias.scope !0, !noalias !4
; CHECK: MayAlias: %1 = load float, float* %c, align 4 <-> store float %1, float* %arrayidx, align 4 ; CHECK: MayAlias: %1 = load float, ptr %c, align 4 <-> store float %1, ptr %arrayidx, align 4
; CHECK: NoAlias: store float %0, float* %arrayidx1.i, align 4, !alias.scope !0, !noalias !4 <-> store float %0, float* %arrayidx.i, align ; CHECK: NoAlias: store float %0, ptr %arrayidx1.i, align 4, !alias.scope !0, !noalias !4 <-> store float %0, ptr %arrayidx.i, align
; CHECK: 4, !alias.scope !4, !noalias !5 ; CHECK: 4, !alias.scope !4, !noalias !5
; CHECK: NoAlias: store float %1, float* %arrayidx, align 4 <-> store float %0, float* %arrayidx.i, align 4, !alias.scope !4, !noalias !5 ; CHECK: NoAlias: store float %1, ptr %arrayidx, align 4 <-> store float %0, ptr %arrayidx.i, align 4, !alias.scope !4, !noalias !5
; CHECK: MayAlias: store float %1, float* %arrayidx, align 4 <-> store float %0, float* %arrayidx1.i, align 4, !alias.scope !0, !noalias ! ; CHECK: MayAlias: store float %1, ptr %arrayidx, align 4 <-> store float %0, ptr %arrayidx1.i, align 4, !alias.scope !0, !noalias !
; CHECK: 4 ; CHECK: 4
} }

View File

@ -1,21 +1,21 @@
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-unknown-linux" target triple = "aarch64-unknown-linux"
attributes #0 = { noinline sanitize_memtag "target-features"="+mte,+neon" } @InterposableAliasWrite1 = linkonce dso_local alias void(ptr), ptr @Write1
@InterposableAliasWrite1 = linkonce dso_local alias void(i8*), void(i8*)* @Write1 @PreemptableAliasWrite1 = dso_preemptable alias void(ptr), ptr @Write1
@AliasToPreemptableAliasWrite1 = dso_local alias void(ptr), ptr @PreemptableAliasWrite1
@PreemptableAliasWrite1 = dso_preemptable alias void(i8*), void(i8*)* @Write1 @AliasWrite1 = dso_local alias void(ptr), ptr @Write1
@AliasToPreemptableAliasWrite1 = dso_local alias void(i8*), void(i8*)* @PreemptableAliasWrite1
@AliasWrite1 = dso_local alias void(i8*), void(i8*)* @Write1 @BitcastAliasWrite1 = dso_local alias void(ptr), ptr @Write1
@AliasToBitcastAliasWrite1 = dso_local alias void(ptr), ptr @BitcastAliasWrite1
@BitcastAliasWrite1 = dso_local alias void(i32*), bitcast (void(i8*)* @Write1 to void(i32*)*)
@AliasToBitcastAliasWrite1 = dso_local alias void(i8*), bitcast (void(i32*)* @BitcastAliasWrite1 to void(i8*)*)
define dso_local void @Write1(i8* %p) #0 { define dso_local void @Write1(ptr %p) #0 {
entry: entry:
store i8 0, i8* %p, align 1 store i8 0, ptr %p, align 1
ret void ret void
} }
attributes #0 = { noinline sanitize_memtag "target-features"="+mte,+neon" }

View File

@ -3,99 +3,95 @@ target triple = "aarch64-unknown-linux"
attributes #0 = { noinline sanitize_memtag "target-features"="+mte,+neon" } attributes #0 = { noinline sanitize_memtag "target-features"="+mte,+neon" }
define dso_local void @Write1(i8* %p) #0 { define dso_local void @Write1(ptr %p) #0 {
entry: entry:
store i8 0, i8* %p, align 1 store i8 0, ptr %p, align 1
ret void ret void
} }
define dso_local void @Write4(i8* %p) #0 { define dso_local void @Write4(ptr %p) #0 {
entry: entry:
%cast = bitcast i8* %p to i32* store i32 0, ptr %p, align 1
store i32 0, i32* %cast, align 1
ret void ret void
} }
define dso_local void @Write4_2(i8* %p, i8* %q) #0 { define dso_local void @Write4_2(ptr %p, ptr %q) #0 {
entry: entry:
%cast0 = bitcast i8* %p to i32* store i32 0, ptr %p, align 1
store i32 0, i32* %cast0, align 1 store i32 0, ptr %q, align 1
%cast1 = bitcast i8* %q to i32*
store i32 0, i32* %cast1, align 1
ret void ret void
} }
define dso_local void @Write8(i8* %p) #0 { define dso_local void @Write8(ptr %p) #0 {
entry: entry:
%cast0 = bitcast i8* %p to i64* store i64 0, ptr %p, align 1
store i64 0, i64* %cast0, align 1
ret void ret void
} }
define dso_local i8* @WriteAndReturn8(i8* %p) #0 { define dso_local ptr @WriteAndReturn8(ptr %p) #0 {
entry: entry:
store i8 0, i8* %p, align 1 store i8 0, ptr %p, align 1
ret i8* %p ret ptr %p
} }
declare dso_local void @ExternalCall(i8* %p) declare dso_local void @ExternalCall(ptr %p)
define dso_preemptable void @PreemptableWrite1(i8* %p) #0 { define dso_preemptable void @PreemptableWrite1(ptr %p) #0 {
entry: entry:
store i8 0, i8* %p, align 1 store i8 0, ptr %p, align 1
ret void ret void
} }
define linkonce dso_local void @InterposableWrite1(i8* %p) #0 { define linkonce dso_local void @InterposableWrite1(ptr %p) #0 {
entry: entry:
store i8 0, i8* %p, align 1 store i8 0, ptr %p, align 1
ret void ret void
} }
define dso_local i8* @ReturnDependent(i8* %p) #0 { define dso_local ptr @ReturnDependent(ptr %p) #0 {
entry: entry:
%p2 = getelementptr i8, i8* %p, i64 2 %p2 = getelementptr i8, ptr %p, i64 2
ret i8* %p2 ret ptr %p2
} }
; access range [2, 6) ; access range [2, 6)
define dso_local void @Rec0(i8* %p) #0 { define dso_local void @Rec0(ptr %p) #0 {
entry: entry:
%p1 = getelementptr i8, i8* %p, i64 2 %p1 = getelementptr i8, ptr %p, i64 2
call void @Write4(i8* %p1) call void @Write4(ptr %p1)
ret void ret void
} }
; access range [3, 7) ; access range [3, 7)
define dso_local void @Rec1(i8* %p) #0 { define dso_local void @Rec1(ptr %p) #0 {
entry: entry:
%p1 = getelementptr i8, i8* %p, i64 1 %p1 = getelementptr i8, ptr %p, i64 1
call void @Rec0(i8* %p1) call void @Rec0(ptr %p1)
ret void ret void
} }
; access range [-2, 2) ; access range [-2, 2)
define dso_local void @Rec2(i8* %p) #0 { define dso_local void @Rec2(ptr %p) #0 {
entry: entry:
%p1 = getelementptr i8, i8* %p, i64 -5 %p1 = getelementptr i8, ptr %p, i64 -5
call void @Rec1(i8* %p1) call void @Rec1(ptr %p1)
ret void ret void
} }
; Recursive function that passes %acc unchanged => access range [0, 4). ; Recursive function that passes %acc unchanged => access range [0, 4).
define dso_local void @RecursiveNoOffset(i32* %p, i32 %size, i32* %acc) { define dso_local void @RecursiveNoOffset(ptr %p, i32 %size, ptr %acc) {
entry: entry:
%cmp = icmp eq i32 %size, 0 %cmp = icmp eq i32 %size, 0
br i1 %cmp, label %return, label %if.end br i1 %cmp, label %return, label %if.end
if.end: if.end:
%load0 = load i32, i32* %p, align 4 %load0 = load i32, ptr %p, align 4
%load1 = load i32, i32* %acc, align 4 %load1 = load i32, ptr %acc, align 4
%add = add nsw i32 %load1, %load0 %add = add nsw i32 %load1, %load0
store i32 %add, i32* %acc, align 4 store i32 %add, ptr %acc, align 4
%add.ptr = getelementptr inbounds i32, i32* %p, i64 1 %add.ptr = getelementptr inbounds i32, ptr %p, i64 1
%sub = add nsw i32 %size, -1 %sub = add nsw i32 %size, -1
tail call void @RecursiveNoOffset(i32* %add.ptr, i32 %sub, i32* %acc) tail call void @RecursiveNoOffset(ptr %add.ptr, i32 %sub, ptr %acc)
ret void ret void
return: return:
@ -103,65 +99,65 @@ return:
} }
; Recursive function that advances %acc on each iteration => access range unlimited. ; Recursive function that advances %acc on each iteration => access range unlimited.
define dso_local void @RecursiveWithOffset(i32 %size, i32* %acc) { define dso_local void @RecursiveWithOffset(i32 %size, ptr %acc) {
entry: entry:
%cmp = icmp eq i32 %size, 0 %cmp = icmp eq i32 %size, 0
br i1 %cmp, label %return, label %if.end br i1 %cmp, label %return, label %if.end
if.end: if.end:
store i32 0, i32* %acc, align 4 store i32 0, ptr %acc, align 4
%acc2 = getelementptr inbounds i32, i32* %acc, i64 1 %acc2 = getelementptr inbounds i32, ptr %acc, i64 1
%sub = add nsw i32 %size, -1 %sub = add nsw i32 %size, -1
tail call void @RecursiveWithOffset(i32 %sub, i32* %acc2) tail call void @RecursiveWithOffset(i32 %sub, ptr %acc2)
ret void ret void
return: return:
ret void ret void
} }
define dso_local i64* @ReturnAlloca() { define dso_local ptr @ReturnAlloca() {
entry: entry:
%x = alloca i64, align 4 %x = alloca i64, align 4
ret i64* %x ret ptr %x
} }
define dso_local void @Write1Private(i8* %p) #0 { define dso_local void @Write1Private(ptr %p) #0 {
entry: entry:
call void @Private(i8* %p) call void @Private(ptr %p)
ret void ret void
} }
define dso_local void @Write1SameModule(i8* %p) #0 { define dso_local void @Write1SameModule(ptr %p) #0 {
entry: entry:
call void @Write1(i8* %p) call void @Write1(ptr %p)
ret void ret void
} }
declare void @Write1Module0(i8* %p) declare void @Write1Module0(ptr %p)
define dso_local void @Write1DiffModule(i8* %p) #0 { define dso_local void @Write1DiffModule(ptr %p) #0 {
entry: entry:
call void @Write1Module0(i8* %p) call void @Write1Module0(ptr %p)
ret void ret void
} }
define private dso_local void @Private(i8* %p) #0 { define private dso_local void @Private(ptr %p) #0 {
entry: entry:
%p1 = getelementptr i8, i8* %p, i64 -1 %p1 = getelementptr i8, ptr %p, i64 -1
store i8 0, i8* %p1, align 1 store i8 0, ptr %p1, align 1
ret void ret void
} }
define dso_local void @Write1Weak(i8* %p) #0 { define dso_local void @Write1Weak(ptr %p) #0 {
entry: entry:
call void @Weak(i8* %p) call void @Weak(ptr %p)
ret void ret void
} }
define weak dso_local void @Weak(i8* %p) #0 { define weak dso_local void @Weak(ptr %p) #0 {
entry: entry:
%p1 = getelementptr i8, i8* %p, i64 -1 %p1 = getelementptr i8, ptr %p, i64 -1
store i8 0, i8* %p1, align 1 store i8 0, ptr %p1, align 1
ret void ret void
} }

View File

@ -14,11 +14,11 @@ target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f8
target triple = "i386-pc-linux-gnu" target triple = "i386-pc-linux-gnu"
; Function Attrs: mustprogress norecurse sanitize_address uwtable ; Function Attrs: mustprogress norecurse sanitize_address uwtable
define dso_local i32 @main(i32 %argc, i8** %argv) { define dso_local i32 @main(i32 %argc, ptr %argv) {
entry: entry:
%0 = alloca i32, align 4 %0 = alloca i32, align 4
%1 = alloca i8, i64 32, align 32 %1 = alloca i8, i64 32, align 32
%2 = ptrtoint i8* %1 to i32 %2 = ptrtoint ptr %1 to i32
store i32 %2, i32* %0, align 4 store i32 %2, ptr %0, align 4
ret i32 0 ret i32 0
} }

View File

@ -33,7 +33,7 @@
; RUN: -r %t.summ1.bc,PreemptableAliasWrite1,px \ ; RUN: -r %t.summ1.bc,PreemptableAliasWrite1,px \
; RUN: -r %t.summ1.bc,Write1,px ; RUN: -r %t.summ1.bc,Write1,px
; RUN: llvm-lto2 run -opaque-pointers=0 %t.summ0.bc %t.summ1.bc -o %t.lto -stack-safety-print -stack-safety-run -save-temps -thinlto-threads 1 -O0 \ ; RUN: llvm-lto2 run %t.summ0.bc %t.summ1.bc -o %t.lto -stack-safety-print -stack-safety-run -save-temps -thinlto-threads 1 -O0 \
; RUN: $(cat %t.res.txt) \ ; RUN: $(cat %t.res.txt) \
; RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK,GLOBAL,LTO ; RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK,GLOBAL,LTO
@ -42,16 +42,16 @@ target triple = "aarch64-unknown-linux"
attributes #0 = { noinline sanitize_memtag "target-features"="+mte,+neon" } attributes #0 = { noinline sanitize_memtag "target-features"="+mte,+neon" }
declare void @PreemptableAliasWrite1(i8* %p) declare void @PreemptableAliasWrite1(ptr %p)
declare void @AliasToPreemptableAliasWrite1(i8* %p) declare void @AliasToPreemptableAliasWrite1(ptr %p)
declare void @InterposableAliasWrite1(i8* %p) declare void @InterposableAliasWrite1(ptr %p)
; Aliases to interposable aliases are not allowed ; Aliases to interposable aliases are not allowed
declare void @AliasWrite1(i8* %p) declare void @AliasWrite1(ptr %p)
declare void @BitcastAliasWrite1(i32* %p) declare void @BitcastAliasWrite1(ptr %p)
declare void @AliasToBitcastAliasWrite1(i8* %p) declare void @AliasToBitcastAliasWrite1(ptr %p)
; Call to dso_preemptable alias to a dso_local aliasee ; Call to dso_preemptable alias to a dso_local aliasee
define void @PreemptableAliasCall() #0 { define void @PreemptableAliasCall() #0 {
@ -66,11 +66,11 @@ define void @PreemptableAliasCall() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x1 = alloca i8 %x1 = alloca i8
call void @PreemptableAliasWrite1(i8* %x1) call void @PreemptableAliasWrite1(ptr %x1)
%x2 = alloca i8 %x2 = alloca i8
; Alias to a preemptable alias is not preemptable ; Alias to a preemptable alias is not preemptable
call void @AliasToPreemptableAliasWrite1(i8* %x2) call void @AliasToPreemptableAliasWrite1(ptr %x2)
ret void ret void
} }
@ -87,7 +87,7 @@ define void @InterposableAliasCall() #0 {
entry: entry:
%x = alloca i8 %x = alloca i8
; ThinLTO can resolve the prevailing implementation for interposable definitions. ; ThinLTO can resolve the prevailing implementation for interposable definitions.
call void @InterposableAliasWrite1(i8* %x) call void @InterposableAliasWrite1(ptr %x)
ret void ret void
} }
@ -102,7 +102,7 @@ define void @AliasCall() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i8 %x = alloca i8
call void @AliasWrite1(i8* %x) call void @AliasWrite1(ptr %x)
ret void ret void
} }
@ -119,9 +119,9 @@ define void @BitcastAliasCall() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x1 = alloca i32 %x1 = alloca i32
call void @BitcastAliasWrite1(i32* %x1) call void @BitcastAliasWrite1(ptr %x1)
%x2 = alloca i8 %x2 = alloca i8
call void @AliasToBitcastAliasWrite1(i8* %x2) call void @AliasToBitcastAliasWrite1(ptr %x2)
ret void ret void
} }
@ -132,5 +132,5 @@ entry:
; CHECK-NEXT: p[]: [0,1){{$}} ; CHECK-NEXT: p[]: [0,1){{$}}
; CHECK-NEXT: allocas uses: ; CHECK-NEXT: allocas uses:
; GLOBAL-NEXT: safe accesses: ; GLOBAL-NEXT: safe accesses:
; GLOBAL-NEXT: store i8 0, i8* %p, align 1 ; GLOBAL-NEXT: store i8 0, ptr %p, align 1
; CHECK-EMPTY: ; CHECK-EMPTY:

View File

@ -83,7 +83,7 @@
; RUN: -r %t.summ1.bc,Write8,px \ ; RUN: -r %t.summ1.bc,Write8,px \
; RUN: -r %t.summ1.bc,WriteAndReturn8,px ; RUN: -r %t.summ1.bc,WriteAndReturn8,px
; RUN: llvm-lto2 run -opaque-pointers=0 %t.summ0.bc %t.summ1.bc -o %t.lto -stack-safety-print -stack-safety-run -save-temps -thinlto-threads 1 -O0 \ ; RUN: llvm-lto2 run %t.summ0.bc %t.summ1.bc -o %t.lto -stack-safety-print -stack-safety-run -save-temps -thinlto-threads 1 -O0 \
; RUN: $(cat %t.res.txt) \ ; RUN: $(cat %t.res.txt) \
; RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK,GLOBAL,LTO ; RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK,GLOBAL,LTO
@ -95,22 +95,22 @@ target triple = "aarch64-unknown-linux"
attributes #0 = { noinline sanitize_memtag "target-features"="+mte,+neon" } attributes #0 = { noinline sanitize_memtag "target-features"="+mte,+neon" }
declare void @Write1(i8* %p) declare void @Write1(ptr %p)
declare void @Write4(i8* %p) declare void @Write4(ptr %p)
declare void @Write4_2(i8* %p, i8* %q) declare void @Write4_2(ptr %p, ptr %q)
declare void @Write8(i8* %p) declare void @Write8(ptr %p)
declare dso_local i8* @WriteAndReturn8(i8* %p) declare dso_local ptr @WriteAndReturn8(ptr %p)
declare dso_local void @ExternalCall(i8* %p) declare dso_local void @ExternalCall(ptr %p)
declare void @PreemptableWrite1(i8* %p) declare void @PreemptableWrite1(ptr %p)
declare void @InterposableWrite1(i8* %p) declare void @InterposableWrite1(ptr %p)
declare i8* @ReturnDependent(i8* %p) declare ptr @ReturnDependent(ptr %p)
declare void @Rec2(i8* %p) declare void @Rec2(ptr %p)
declare void @RecursiveNoOffset(i32* %p, i32 %size, i32* %acc) declare void @RecursiveNoOffset(ptr %p, i32 %size, ptr %acc)
declare void @RecursiveWithOffset(i32 %size, i32* %acc) declare void @RecursiveWithOffset(i32 %size, ptr %acc)
declare void @Write1SameModule(i8* %p) declare void @Write1SameModule(ptr %p)
declare void @Write1DiffModule(i8* %p) declare void @Write1DiffModule(ptr %p)
declare void @Write1Private(i8* %p) declare void @Write1Private(ptr %p)
declare void @Write1Weak(i8* %p) declare void @Write1Weak(ptr %p)
; Basic out-of-bounds. ; Basic out-of-bounds.
define void @f1() #0 { define void @f1() #0 {
@ -123,8 +123,7 @@ define void @f1() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%x1 = bitcast i32* %x to i8* call void @Write8(ptr %x)
call void @Write8(i8* %x1)
ret void ret void
} }
@ -139,8 +138,7 @@ define void @f2() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%x1 = bitcast i32* %x to i8* call void @Write1(ptr %x)
call void @Write1(i8* %x1)
ret void ret void
} }
@ -155,8 +153,7 @@ define void @f3() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%x1 = bitcast i32* %x to i8* call void @Write4(ptr %x)
call void @Write4(i8* %x1)
ret void ret void
} }
@ -171,9 +168,8 @@ define void @f4() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%x1 = bitcast i32* %x to i8* %x2 = getelementptr i8, ptr %x, i64 1
%x2 = getelementptr i8, i8* %x1, i64 1 call void @Write1(ptr %x2)
call void @Write1(i8* %x2)
ret void ret void
} }
@ -188,9 +184,8 @@ define void @f5() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%x1 = bitcast i32* %x to i8* %x2 = getelementptr i8, ptr %x, i64 1
%x2 = getelementptr i8, i8* %x1, i64 1 call void @Write4(ptr %x2)
call void @Write4(i8* %x2)
ret void ret void
} }
@ -205,8 +200,7 @@ define void @f6() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%x1 = bitcast i32* %x to i8* call void @ExternalCall(ptr %x)
call void @ExternalCall(i8* %x1)
ret void ret void
} }
@ -221,8 +215,7 @@ define void @PreemptableCall() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%x1 = bitcast i32* %x to i8* call void @PreemptableWrite1(ptr %x)
call void @PreemptableWrite1(i8* %x1)
ret void ret void
} }
@ -238,8 +231,7 @@ define void @InterposableCall() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%x1 = bitcast i32* %x to i8* call void @InterposableWrite1(ptr %x)
call void @InterposableWrite1(i8* %x1)
ret void ret void
} }
@ -254,21 +246,20 @@ define void @PrivateCall() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%x1 = bitcast i32* %x to i8* call void @PrivateWrite1(ptr %x)
call void @PrivateWrite1(i8* %x1)
ret void ret void
} }
define private void @PrivateWrite1(i8* %p) #0 { define private void @PrivateWrite1(ptr %p) #0 {
; CHECK-LABEL: @PrivateWrite1{{$}} ; CHECK-LABEL: @PrivateWrite1{{$}}
; CHECK-NEXT: args uses: ; CHECK-NEXT: args uses:
; CHECK-NEXT: p[]: [0,1){{$}} ; CHECK-NEXT: p[]: [0,1){{$}}
; CHECK-NEXT: allocas uses: ; CHECK-NEXT: allocas uses:
; GLOBAL-NEXT: safe accesses: ; GLOBAL-NEXT: safe accesses:
; GLOBAL-NEXT: store i8 0, i8* %p, align 1 ; GLOBAL-NEXT: store i8 0, ptr %p, align 1
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
store i8 0, i8* %p, align 1 store i8 0, ptr %p, align 1
ret void ret void
} }
@ -284,8 +275,7 @@ define void @f7() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%x1 = bitcast i32* %x to i8* %x2 = call ptr @ReturnDependent(ptr %x)
%x2 = call i8* @ReturnDependent(i8* %x1)
ret void ret void
} }
@ -299,10 +289,9 @@ define void @f8left() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i64, align 4 %x = alloca i64, align 4
%x1 = bitcast i64* %x to i8* %x2 = getelementptr i8, ptr %x, i64 2
%x2 = getelementptr i8, i8* %x1, i64 2
; 2 + [-2, 2) = [0, 4) => OK ; 2 + [-2, 2) = [0, 4) => OK
call void @Rec2(i8* %x2) call void @Rec2(ptr %x2)
ret void ret void
} }
@ -316,10 +305,9 @@ define void @f8right() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i64, align 4 %x = alloca i64, align 4
%x1 = bitcast i64* %x to i8* %x2 = getelementptr i8, ptr %x, i64 6
%x2 = getelementptr i8, i8* %x1, i64 6
; 6 + [-2, 2) = [4, 8) => OK ; 6 + [-2, 2) = [4, 8) => OK
call void @Rec2(i8* %x2) call void @Rec2(ptr %x2)
ret void ret void
} }
@ -333,10 +321,9 @@ define void @f8oobleft() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i64, align 4 %x = alloca i64, align 4
%x1 = bitcast i64* %x to i8* %x2 = getelementptr i8, ptr %x, i64 1
%x2 = getelementptr i8, i8* %x1, i64 1
; 1 + [-2, 2) = [-1, 3) => NOT OK ; 1 + [-2, 2) = [-1, 3) => NOT OK
call void @Rec2(i8* %x2) call void @Rec2(ptr %x2)
ret void ret void
} }
@ -350,10 +337,9 @@ define void @f8oobright() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i64, align 4 %x = alloca i64, align 4
%x1 = bitcast i64* %x to i8* %x2 = getelementptr i8, ptr %x, i64 7
%x2 = getelementptr i8, i8* %x1, i64 7
; 7 + [-2, 2) = [5, 9) => NOT OK ; 7 + [-2, 2) = [5, 9) => NOT OK
call void @Rec2(i8* %x2) call void @Rec2(ptr %x2)
ret void ret void
} }
@ -367,9 +353,8 @@ define void @TwoArguments() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i64, align 4 %x = alloca i64, align 4
%x1 = bitcast i64* %x to i8* %x2 = getelementptr i8, ptr %x, i64 4
%x2 = getelementptr i8, i8* %x1, i64 4 call void @Write4_2(ptr %x2, ptr %x)
call void @Write4_2(i8* %x2, i8* %x1)
ret void ret void
} }
@ -383,9 +368,8 @@ define void @TwoArgumentsOOBOne() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i64, align 4 %x = alloca i64, align 4
%x1 = bitcast i64* %x to i8* %x2 = getelementptr i8, ptr %x, i64 5
%x2 = getelementptr i8, i8* %x1, i64 5 call void @Write4_2(ptr %x2, ptr %x)
call void @Write4_2(i8* %x2, i8* %x1)
ret void ret void
} }
@ -399,10 +383,9 @@ define void @TwoArgumentsOOBOther() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i64, align 4 %x = alloca i64, align 4
%x0 = bitcast i64* %x to i8* %x1 = getelementptr i8, ptr %x, i64 -1
%x1 = getelementptr i8, i8* %x0, i64 -1 %x2 = getelementptr i8, ptr %x, i64 4
%x2 = getelementptr i8, i8* %x0, i64 4 call void @Write4_2(ptr %x2, ptr %x1)
call void @Write4_2(i8* %x2, i8* %x1)
ret void ret void
} }
@ -416,14 +399,13 @@ define void @TwoArgumentsOOBBoth() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i64, align 4 %x = alloca i64, align 4
%x0 = bitcast i64* %x to i8* %x1 = getelementptr i8, ptr %x, i64 -1
%x1 = getelementptr i8, i8* %x0, i64 -1 %x2 = getelementptr i8, ptr %x, i64 5
%x2 = getelementptr i8, i8* %x0, i64 5 call void @Write4_2(ptr %x2, ptr %x1)
call void @Write4_2(i8* %x2, i8* %x1)
ret void ret void
} }
define i32 @TestRecursiveNoOffset(i32* %p, i32 %size) #0 { define i32 @TestRecursiveNoOffset(ptr %p, i32 %size) #0 {
; CHECK-LABEL: @TestRecursiveNoOffset dso_preemptable{{$}} ; CHECK-LABEL: @TestRecursiveNoOffset dso_preemptable{{$}}
; CHECK-NEXT: args uses: ; CHECK-NEXT: args uses:
; LOCAL-NEXT: p[]: empty-set, @RecursiveNoOffset(arg0, [0,1)){{$}} ; LOCAL-NEXT: p[]: empty-set, @RecursiveNoOffset(arg0, [0,1)){{$}}
@ -431,16 +413,15 @@ define i32 @TestRecursiveNoOffset(i32* %p, i32 %size) #0 {
; CHECK-NEXT: allocas uses: ; CHECK-NEXT: allocas uses:
; CHECK-NEXT: sum[4]: [0,4), @RecursiveNoOffset(arg2, [0,1)){{$}} ; CHECK-NEXT: sum[4]: [0,4), @RecursiveNoOffset(arg2, [0,1)){{$}}
; GLOBAL-NEXT: safe accesses: ; GLOBAL-NEXT: safe accesses:
; GLOBAL-NEXT: store i32 0, i32* %sum, align 4 ; GLOBAL-NEXT: store i32 0, ptr %sum, align 4
; GLOBAL-NEXT: %1 = load i32, i32* %sum, align 4 ; GLOBAL-NEXT: %load = load i32, ptr %sum, align 4
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%sum = alloca i32, align 4 %sum = alloca i32, align 4
%0 = bitcast i32* %sum to i8* store i32 0, ptr %sum, align 4
store i32 0, i32* %sum, align 4 call void @RecursiveNoOffset(ptr %p, i32 %size, ptr %sum)
call void @RecursiveNoOffset(i32* %p, i32 %size, i32* %sum) %load = load i32, ptr %sum, align 4
%1 = load i32, i32* %sum, align 4 ret i32 %load
ret i32 %1
} }
define void @TestRecursiveWithOffset(i32 %size) #0 { define void @TestRecursiveWithOffset(i32 %size) #0 {
@ -453,7 +434,7 @@ define void @TestRecursiveWithOffset(i32 %size) #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%sum = alloca i32, i64 16, align 4 %sum = alloca i32, i64 16, align 4
call void @RecursiveWithOffset(i32 %size, i32* %sum) call void @RecursiveWithOffset(i32 %size, ptr %sum)
ret void ret void
} }
@ -468,7 +449,7 @@ define void @TestUpdateArg() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i8, i64 16, align 4 %x = alloca i8, i64 16, align 4
%0 = call i8* @WriteAndReturn8(i8* %x) %0 = call ptr @WriteAndReturn8(ptr %x)
ret void ret void
} }
@ -482,7 +463,7 @@ define void @TestCrossModuleOnce() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%y = alloca i8, align 4 %y = alloca i8, align 4
call void @Write1SameModule(i8* %y) call void @Write1SameModule(ptr %y)
ret void ret void
} }
@ -496,7 +477,7 @@ define void @TestCrossModuleTwice() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%z = alloca i8, align 4 %z = alloca i8, align 4
call void @Write1DiffModule(i8* %z) call void @Write1DiffModule(ptr %z)
ret void ret void
} }
@ -510,7 +491,7 @@ define void @TestCrossModuleConflict() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i8, align 4 %x = alloca i8, align 4
call void @Write1Private(i8* %x) call void @Write1Private(ptr %x)
ret void ret void
} }
@ -526,27 +507,27 @@ define void @TestCrossModuleWeak() #0 {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i8, align 4 %x = alloca i8, align 4
call void @Write1Weak(i8* %x) call void @Write1Weak(ptr %x)
ret void ret void
} }
define private dso_local void @Private(i8* %p) #0 { define private dso_local void @Private(ptr %p) #0 {
entry: entry:
%p1 = getelementptr i8, i8* %p, i64 1 %p1 = getelementptr i8, ptr %p, i64 1
store i8 0, i8* %p1, align 1 store i8 0, ptr %p1, align 1
ret void ret void
} }
define dso_local void @Write1Module0(i8* %p) #0 { define dso_local void @Write1Module0(ptr %p) #0 {
entry: entry:
store i8 0, i8* %p, align 1 store i8 0, ptr %p, align 1
ret void ret void
} }
define dso_local void @Weak(i8* %p) #0 { define dso_local void @Weak(ptr %p) #0 {
entry: entry:
%p1 = getelementptr i8, i8* %p, i64 1 %p1 = getelementptr i8, ptr %p, i64 1
store i8 0, i8* %p1, align 1 store i8 0, ptr %p1, align 1
ret void ret void
} }
@ -557,7 +538,7 @@ entry:
; CHECK-NEXT: p[]: [0,1){{$}} ; CHECK-NEXT: p[]: [0,1){{$}}
; CHECK-NEXT: allocas uses: ; CHECK-NEXT: allocas uses:
; GLOBAL-NEXT: safe accesses: ; GLOBAL-NEXT: safe accesses:
; GLOBAL-NEXT: store i8 0, i8* %p, align 1 ; GLOBAL-NEXT: store i8 0, ptr %p, align 1
; CHECK-EMPTY: ; CHECK-EMPTY:
; CHECK-LABEL: @Write4{{$}} ; CHECK-LABEL: @Write4{{$}}
@ -565,7 +546,7 @@ entry:
; CHECK-NEXT: p[]: [0,4){{$}} ; CHECK-NEXT: p[]: [0,4){{$}}
; CHECK-NEXT: allocas uses: ; CHECK-NEXT: allocas uses:
; GLOBAL-NEXT: safe accesses: ; GLOBAL-NEXT: safe accesses:
; GLOBAL-NEXT: store i32 0, i32* %cast, align 1 ; GLOBAL-NEXT: store i32 0, ptr %p, align 1
; CHECK-EMPTY: ; CHECK-EMPTY:
; CHECK-LABEL: @Write4_2{{$}} ; CHECK-LABEL: @Write4_2{{$}}
@ -574,8 +555,8 @@ entry:
; CHECK-NEXT: q[]: [0,4){{$}} ; CHECK-NEXT: q[]: [0,4){{$}}
; CHECK-NEXT: allocas uses: ; CHECK-NEXT: allocas uses:
; GLOBAL-NEXT: safe accesses: ; GLOBAL-NEXT: safe accesses:
; GLOBAL-NEXT: store i32 0, i32* %cast0, align 1 ; GLOBAL-NEXT: store i32 0, ptr %p, align 1
; GLOBAL-NEXT: store i32 0, i32* %cast1, align 1 ; GLOBAL-NEXT: store i32 0, ptr %q, align 1
; CHECK-EMPTY: ; CHECK-EMPTY:
; CHECK-LABEL: @Write8{{$}} ; CHECK-LABEL: @Write8{{$}}
@ -583,7 +564,7 @@ entry:
; CHECK-NEXT: p[]: [0,8){{$}} ; CHECK-NEXT: p[]: [0,8){{$}}
; CHECK-NEXT: allocas uses: ; CHECK-NEXT: allocas uses:
; GLOBAL-NEXT: safe accesses: ; GLOBAL-NEXT: safe accesses:
; GLOBAL-NEXT: store i64 0, i64* %cast0, align 1 ; GLOBAL-NEXT: store i64 0, ptr %p, align 1
; CHECK-EMPTY: ; CHECK-EMPTY:
; CHECK-LABEL: @WriteAndReturn8{{$}} ; CHECK-LABEL: @WriteAndReturn8{{$}}
@ -591,7 +572,7 @@ entry:
; CHECK-NEXT: p[]: full-set{{$}} ; CHECK-NEXT: p[]: full-set{{$}}
; CHECK-NEXT: allocas uses: ; CHECK-NEXT: allocas uses:
; GLOBAL-NEXT: safe accesses: ; GLOBAL-NEXT: safe accesses:
; GLOBAL-NEXT: store i8 0, i8* %p, align 1 ; GLOBAL-NEXT: store i8 0, ptr %p, align 1
; CHECK-EMPTY: ; CHECK-EMPTY:
; CHECK-LABEL: @PreemptableWrite1 dso_preemptable{{$}} ; CHECK-LABEL: @PreemptableWrite1 dso_preemptable{{$}}
@ -599,7 +580,7 @@ entry:
; CHECK-NEXT: p[]: [0,1){{$}} ; CHECK-NEXT: p[]: [0,1){{$}}
; CHECK-NEXT: allocas uses: ; CHECK-NEXT: allocas uses:
; GLOBAL-NEXT: safe accesses: ; GLOBAL-NEXT: safe accesses:
; GLOBAL-NEXT: store i8 0, i8* %p, align 1 ; GLOBAL-NEXT: store i8 0, ptr %p, align 1
; CHECK-EMPTY: ; CHECK-EMPTY:
; CHECK-LABEL: @InterposableWrite1 interposable{{$}} ; CHECK-LABEL: @InterposableWrite1 interposable{{$}}
@ -607,7 +588,7 @@ entry:
; CHECK-NEXT: p[]: [0,1){{$}} ; CHECK-NEXT: p[]: [0,1){{$}}
; CHECK-NEXT: allocas uses: ; CHECK-NEXT: allocas uses:
; GLOBAL-NEXT: safe accesses: ; GLOBAL-NEXT: safe accesses:
; GLOBAL-NEXT: store i8 0, i8* %p, align 1 ; GLOBAL-NEXT: store i8 0, ptr %p, align 1
; CHECK-EMPTY: ; CHECK-EMPTY:
; CHECK-LABEL: @ReturnDependent{{$}} ; CHECK-LABEL: @ReturnDependent{{$}}
@ -648,9 +629,9 @@ entry:
; CHECK-NEXT: acc[]: [0,4), @RecursiveNoOffset(arg2, [0,1)){{$}} ; CHECK-NEXT: acc[]: [0,4), @RecursiveNoOffset(arg2, [0,1)){{$}}
; CHECK-NEXT: allocas uses: ; CHECK-NEXT: allocas uses:
; GLOBAL-NEXT: safe accesses: ; GLOBAL-NEXT: safe accesses:
; GLOBAL-NEXT: %load0 = load i32, i32* %p, align 4 ; GLOBAL-NEXT: %load0 = load i32, ptr %p, align 4
; GLOBAL-NEXT: %load1 = load i32, i32* %acc, align 4 ; GLOBAL-NEXT: %load1 = load i32, ptr %acc, align 4
; GLOBAL-NEXT: store i32 %add, i32* %acc, align 4 ; GLOBAL-NEXT: store i32 %add, ptr %acc, align 4
; CHECK-EMPTY: ; CHECK-EMPTY:
; CHECK-LABEL: @RecursiveWithOffset{{$}} ; CHECK-LABEL: @RecursiveWithOffset{{$}}
@ -659,7 +640,7 @@ entry:
; GLOBAL-NEXT: acc[]: full-set, @RecursiveWithOffset(arg1, [4,5)){{$}} ; GLOBAL-NEXT: acc[]: full-set, @RecursiveWithOffset(arg1, [4,5)){{$}}
; CHECK-NEXT: allocas uses: ; CHECK-NEXT: allocas uses:
; GLOBAL-NEXT: safe accesses: ; GLOBAL-NEXT: safe accesses:
; GLOBAL-NEXT: store i32 0, i32* %acc, align 4 ; GLOBAL-NEXT: store i32 0, ptr %acc, align 4
; CHECK-EMPTY: ; CHECK-EMPTY:
; CHECK-LABEL: @ReturnAlloca ; CHECK-LABEL: @ReturnAlloca

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -4,10 +4,10 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu" target triple = "x86_64-unknown-linux-gnu"
declare void @llvm.memset.p0i8.i64(i8* %dest, i8 %val, i64 %len, i1 %isvolatile) declare void @llvm.memset.p0.i64(ptr %dest, i8 %val, i64 %len, i1 %isvolatile)
declare void @llvm.memset.p0i8.i32(i8* %dest, i8 %val, i32 %len, i1 %isvolatile) declare void @llvm.memset.p0.i32(ptr %dest, i8 %val, i32 %len, i1 %isvolatile)
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i1 %isvolatile) declare void @llvm.memcpy.p0.p0.i32(ptr %dest, ptr %src, i32 %len, i1 %isvolatile)
declare void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i1 %isvolatile) declare void @llvm.memmove.p0.p0.i32(ptr %dest, ptr %src, i32 %len, i1 %isvolatile)
define void @MemsetInBounds() { define void @MemsetInBounds() {
; CHECK-LABEL: MemsetInBounds dso_preemptable{{$}} ; CHECK-LABEL: MemsetInBounds dso_preemptable{{$}}
@ -15,12 +15,11 @@ define void @MemsetInBounds() {
; CHECK-NEXT: allocas uses: ; CHECK-NEXT: allocas uses:
; CHECK-NEXT: x[4]: [0,4){{$}} ; CHECK-NEXT: x[4]: [0,4){{$}}
; GLOBAL-NEXT: safe accesses: ; GLOBAL-NEXT: safe accesses:
; GLOBAL-NEXT: call void @llvm.memset.p0i8.i32(i8* %x1, i8 42, i32 4, i1 false) ; GLOBAL-NEXT: call void @llvm.memset.p0.i32(ptr %x, i8 42, i32 4, i1 false)
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%x1 = bitcast i32* %x to i8* call void @llvm.memset.p0.i32(ptr %x, i8 42, i32 4, i1 false)
call void @llvm.memset.p0i8.i32(i8* %x1, i8 42, i32 4, i1 false)
ret void ret void
} }
@ -31,12 +30,11 @@ define void @VolatileMemsetInBounds() {
; CHECK-NEXT: allocas uses: ; CHECK-NEXT: allocas uses:
; CHECK-NEXT: x[4]: [0,4){{$}} ; CHECK-NEXT: x[4]: [0,4){{$}}
; GLOBAL-NEXT: safe accesses: ; GLOBAL-NEXT: safe accesses:
; GLOBAL-NEXT: call void @llvm.memset.p0i8.i32(i8* %x1, i8 42, i32 4, i1 true) ; GLOBAL-NEXT: call void @llvm.memset.p0.i32(ptr %x, i8 42, i32 4, i1 true)
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%x1 = bitcast i32* %x to i8* call void @llvm.memset.p0.i32(ptr %x, i8 42, i32 4, i1 true)
call void @llvm.memset.p0i8.i32(i8* %x1, i8 42, i32 4, i1 true)
ret void ret void
} }
@ -49,8 +47,7 @@ define void @MemsetOutOfBounds() {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%x1 = bitcast i32* %x to i8* call void @llvm.memset.p0.i32(ptr %x, i8 42, i32 5, i1 false)
call void @llvm.memset.p0i8.i32(i8* %x1, i8 42, i32 5, i1 false)
ret void ret void
} }
@ -63,8 +60,7 @@ define void @MemsetNonConst(i32 %size) {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%x1 = bitcast i32* %x to i8* call void @llvm.memset.p0.i32(ptr %x, i8 42, i32 %size, i1 false)
call void @llvm.memset.p0i8.i32(i8* %x1, i8 42, i32 %size, i1 false)
ret void ret void
} }
@ -79,9 +75,8 @@ define void @MemsetNonConstInBounds(i1 zeroext %z) {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%x1 = bitcast i32* %x to i8*
%size = select i1 %z, i32 3, i32 4 %size = select i1 %z, i32 3, i32 4
call void @llvm.memset.p0i8.i32(i8* %x1, i8 42, i32 %size, i1 false) call void @llvm.memset.p0.i32(ptr %x, i8 42, i32 %size, i1 false)
ret void ret void
} }
@ -96,11 +91,10 @@ define void @MemsetNonConstSize() {
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%y = alloca i32, align 4 %y = alloca i32, align 4
%x1 = bitcast i32* %x to i8* %xint = ptrtoint ptr %x to i32
%xint = ptrtoint i32* %x to i32 %yint = ptrtoint ptr %y to i32
%yint = ptrtoint i32* %y to i32
%d = sub i32 %xint, %yint %d = sub i32 %xint, %yint
call void @llvm.memset.p0i8.i32(i8* %x1, i8 42, i32 %d, i1 false) call void @llvm.memset.p0.i32(ptr %x, i8 42, i32 %d, i1 false)
ret void ret void
} }
@ -111,14 +105,12 @@ define void @MemcpyInBounds() {
; CHECK-NEXT: x[4]: [0,4){{$}} ; CHECK-NEXT: x[4]: [0,4){{$}}
; CHECK-NEXT: y[4]: [0,4){{$}} ; CHECK-NEXT: y[4]: [0,4){{$}}
; GLOBAL-NEXT: safe accesses: ; GLOBAL-NEXT: safe accesses:
; GLOBAL-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x1, i8* %y1, i32 4, i1 false) ; GLOBAL-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr %x, ptr %y, i32 4, i1 false)
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%y = alloca i32, align 4 %y = alloca i32, align 4
%x1 = bitcast i32* %x to i8* call void @llvm.memcpy.p0.p0.i32(ptr %x, ptr %y, i32 4, i1 false)
%y1 = bitcast i32* %y to i8*
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x1, i8* %y1, i32 4, i1 false)
ret void ret void
} }
@ -133,9 +125,7 @@ define void @MemcpySrcOutOfBounds() {
entry: entry:
%x = alloca i64, align 4 %x = alloca i64, align 4
%y = alloca i32, align 4 %y = alloca i32, align 4
%x1 = bitcast i64* %x to i8* call void @llvm.memcpy.p0.p0.i32(ptr %x, ptr %y, i32 5, i1 false)
%y1 = bitcast i32* %y to i8*
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x1, i8* %y1, i32 5, i1 false)
ret void ret void
} }
@ -150,9 +140,7 @@ define void @MemcpyDstOutOfBounds() {
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%y = alloca i64, align 4 %y = alloca i64, align 4
%x1 = bitcast i32* %x to i8* call void @llvm.memcpy.p0.p0.i32(ptr %x, ptr %y, i32 5, i1 false)
%y1 = bitcast i64* %y to i8*
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x1, i8* %y1, i32 5, i1 false)
ret void ret void
} }
@ -167,9 +155,7 @@ define void @MemcpyBothOutOfBounds() {
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%y = alloca i64, align 4 %y = alloca i64, align 4
%x1 = bitcast i32* %x to i8* call void @llvm.memcpy.p0.p0.i32(ptr %x, ptr %y, i32 9, i1 false)
%y1 = bitcast i64* %y to i8*
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x1, i8* %y1, i32 9, i1 false)
ret void ret void
} }
@ -179,13 +165,12 @@ define void @MemcpySelfInBounds() {
; CHECK-NEXT: allocas uses: ; CHECK-NEXT: allocas uses:
; CHECK-NEXT: x[8]: [0,8){{$}} ; CHECK-NEXT: x[8]: [0,8){{$}}
; GLOBAL-NEXT: safe accesses ; GLOBAL-NEXT: safe accesses
; GLOBAL-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x1, i8* %x2, i32 3, i1 false) ; GLOBAL-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr %x, ptr %x2, i32 3, i1 false)
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i64, align 4 %x = alloca i64, align 4
%x1 = bitcast i64* %x to i8* %x2 = getelementptr i8, ptr %x, i64 5
%x2 = getelementptr i8, i8* %x1, i64 5 call void @llvm.memcpy.p0.p0.i32(ptr %x, ptr %x2, i32 3, i1 false)
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x1, i8* %x2, i32 3, i1 false)
ret void ret void
} }
@ -198,9 +183,8 @@ define void @MemcpySelfSrcOutOfBounds() {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i64, align 4 %x = alloca i64, align 4
%x1 = bitcast i64* %x to i8* %x2 = getelementptr i8, ptr %x, i64 5
%x2 = getelementptr i8, i8* %x1, i64 5 call void @llvm.memcpy.p0.p0.i32(ptr %x, ptr %x2, i32 4, i1 false)
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x1, i8* %x2, i32 4, i1 false)
ret void ret void
} }
@ -213,9 +197,8 @@ define void @MemcpySelfDstOutOfBounds() {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i64, align 4 %x = alloca i64, align 4
%x1 = bitcast i64* %x to i8* %x2 = getelementptr i8, ptr %x, i64 5
%x2 = getelementptr i8, i8* %x1, i64 5 call void @llvm.memcpy.p0.p0.i32(ptr %x2, ptr %x, i32 4, i1 false)
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x2, i8* %x1, i32 4, i1 false)
ret void ret void
} }
@ -228,9 +211,8 @@ define void @MemmoveSelfBothOutOfBounds() {
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i64, align 4 %x = alloca i64, align 4
%x1 = bitcast i64* %x to i8* %x2 = getelementptr i8, ptr %x, i64 5
%x2 = getelementptr i8, i8* %x1, i64 5 call void @llvm.memmove.p0.p0.i32(ptr %x, ptr %x2, i32 9, i1 false)
call void @llvm.memmove.p0i8.p0i8.i32(i8* %x1, i8* %x2, i32 9, i1 false)
ret void ret void
} }
@ -241,14 +223,13 @@ define void @MemsetInBoundsCast() {
; CHECK-NEXT: x[4]: [0,4){{$}} ; CHECK-NEXT: x[4]: [0,4){{$}}
; CHECK-NEXT: y[1]: empty-set{{$}} ; CHECK-NEXT: y[1]: empty-set{{$}}
; GLOBAL-NEXT: safe accesses: ; GLOBAL-NEXT: safe accesses:
; GLOBAL-NEXT: call void @llvm.memset.p0i8.i32(i8* %x1, i8 %yint, i32 4, i1 false) ; GLOBAL-NEXT: call void @llvm.memset.p0.i32(ptr %x, i8 %yint, i32 4, i1 false)
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca i32, align 4 %x = alloca i32, align 4
%y = alloca i8, align 1 %y = alloca i8, align 1
%x1 = bitcast i32* %x to i8* %yint = ptrtoint ptr %y to i8
%yint = ptrtoint i8* %y to i8 call void @llvm.memset.p0.i32(ptr %x, i8 %yint, i32 4, i1 false)
call void @llvm.memset.p0i8.i32(i8* %x1, i8 %yint, i32 4, i1 false)
ret void ret void
} }
@ -260,15 +241,13 @@ define void @MemcpyInBoundsCast2(i8 %zint8) {
; CHECK-NEXT: y[256]: [0,255){{$}} ; CHECK-NEXT: y[256]: [0,255){{$}}
; CHECK-NEXT: z[1]: empty-set{{$}} ; CHECK-NEXT: z[1]: empty-set{{$}}
; GLOBAL-NEXT: safe accesses: ; GLOBAL-NEXT: safe accesses:
; GLOBAL-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x1, i8* %y1, i32 %zint32, i1 false) ; GLOBAL-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr %x, ptr %y, i32 %zint32, i1 false)
; CHECK-EMPTY: ; CHECK-EMPTY:
entry: entry:
%x = alloca [256 x i8], align 4 %x = alloca [256 x i8], align 4
%y = alloca [256 x i8], align 4 %y = alloca [256 x i8], align 4
%z = alloca i8, align 1 %z = alloca i8, align 1
%x1 = bitcast [256 x i8]* %x to i8*
%y1 = bitcast [256 x i8]* %y to i8*
%zint32 = zext i8 %zint8 to i32 %zint32 = zext i8 %zint8 to i32
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x1, i8* %y1, i32 %zint32, i1 false) call void @llvm.memcpy.p0.p0.i32(ptr %x, ptr %y, i32 %zint32, i1 false)
ret void ret void
} }