; 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'
entry:
br label %body
body:
%iv = phi i32 [ 0, %entry ], [ %next, %body ]
%base = phi i32 [ 0, %entry ], [ %sum, %body ]
- %arrayidx = getelementptr inbounds i32, i32* %a, i32 %iv
- %0 = load i32, i32* %arrayidx
+ %arrayidx = getelementptr inbounds i32, ptr %a, i32 %iv
+ %0 = load i32, ptr %arrayidx
%sum = add nsw i32 %0, %base
%next = add i32 %iv, 1
%exitcond = icmp eq i32 %next, %i
!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
; are marked as not expected to be taken.
; TODO(dnovillo) The calls to regular_function should not be merged, but
; CHECK: edge entry -> else probability is 0x78787f1d / 0x80000000 = 94.12% [HOT edge]
entry:
- %gep1 = getelementptr i32, i32* %a, i32 1
- %val1 = load i32, i32* %gep1
+ %gep1 = getelementptr i32, ptr %a, i32 1
+ %val1 = load i32, ptr %gep1
%cond1 = icmp ugt i32 %val1, 1
br i1 %cond1, label %then, label %else
br label %exit
else:
- %gep2 = getelementptr i32, i32* %a, i32 2
- %val2 = load i32, i32* %gep2
+ %gep2 = getelementptr i32, ptr %a, i32 2
+ %val2 = load i32, ptr %gep2
%val3 = call i32 @regular_function(i32 %val2)
br label %exit
}
; 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:
br i1 %c, label %if.then, label %if.end
; Edge "entry->if.end" should have higher probability based on the cold call
br label %if.end
lpad:
- %ll = landingpad { i8*, i32 }
+ %ll = landingpad { ptr, i32 }
cleanup
br label %if.end
}
; 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:
br i1 %c, label %if.then, label %if.end
br label %if.end
lpad:
- %ll = landingpad { i8*, i32 }
+ %ll = landingpad { ptr, i32 }
cleanup
call void @ColdFunc() #0
br label %if.end
}
; 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:
br i1 %c, label %if.then, label %if.end
; CHECK: edge entry -> if.then probability is 0x078780e3 / 0x80000000 = 5.88%
br label %if.end
lpad:
- %ll = landingpad { i8*, i32 }
+ %ll = landingpad { ptr, i32 }
cleanup
call void @ColdFunc() #0
br label %if.end
}
; 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:
; CHECK: edge entry -> invoke.to0 probability is 0x7ffff800 / 0x80000000 = 100.00% [HOT edge]
; CHECK: edge entry -> lpad probability is 0x00000800 / 0x80000000 = 0.00%
ret void
lpad:
- %ll = landingpad { i8*, i32 }
+ %ll = landingpad { ptr, i32 }
cleanup
ret void
}
; 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 @bar()
declare void @llvm.experimental.deoptimize.isVoid(...)
; 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.
-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 -> invoke probability is 0x7fffffff / 0x80000000 = 100.00% [HOT edge]
;CHECK: edge invoke -> invoke.cont.unreached probability is 0x00000000 / 0x80000000 = 0.00%
unreachable
land.pad:
- %v20 = landingpad { i8*, i32 }
+ %v20 = landingpad { ptr, i32 }
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
exit:
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 -> invoke probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
;CHECK: edge invoke -> invoke.cont.cold probability is 0x7fff8000 / 0x80000000 = 100.00% [HOT edge]
unreachable
land.pad:
- %v20 = landingpad { i8*, i32 }
+ %v20 = landingpad { ptr, i32 }
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
exit:
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 -> invoke probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
;CHECK: edge invoke -> invoke.cont.cold probability is 0x7fff8000 / 0x80000000 = 100.00% [HOT edge]
unreachable
land.pad:
- %v20 = landingpad { i8*, i32 }
+ %v20 = landingpad { ptr, i32 }
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()
br label %exit
; RUN: opt < %s -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s
-declare i32 @strcmp(i8*, i8*)
-declare i32 @strncmp(i8*, i8*, i32)
-declare i32 @strcasecmp(i8*, i8*)
-declare i32 @strncasecmp(i8*, i8*, i32)
-declare i32 @memcmp(i8*, i8*)
-declare i32 @bcmp(i8*, i8*)
-declare i32 @nonstrcmp(i8*, i8*)
+declare i32 @strcmp(ptr, ptr)
+declare i32 @strncmp(ptr, ptr, i32)
+declare i32 @strcasecmp(ptr, ptr)
+declare i32 @strncasecmp(ptr, ptr, i32)
+declare i32 @memcmp(ptr, ptr)
+declare i32 @bcmp(ptr, ptr)
+declare i32 @nonstrcmp(ptr, ptr)
; Check that the result of strcmp is considered more likely to be nonzero than
; 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'
entry:
- %val = call i32 @strcmp(i8* %p, i8* %q)
+ %val = call i32 @strcmp(ptr %p, ptr %q)
%cond = icmp eq i32 %val, 0
br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x30000000 / 0x80000000 = 37.50%
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'
entry:
- %val = call i32 @strcmp(i8* %p, i8* %q)
+ %val = call i32 @strcmp(ptr %p, ptr %q)
%cond = icmp eq i32 %val, 5
br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x30000000 / 0x80000000 = 37.50%
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'
entry:
- %val = call i32 @strcmp(i8* %p, i8* %q)
+ %val = call i32 @strcmp(ptr %p, ptr %q)
%cond = icmp ne i32 %val, 0
br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x50000000 / 0x80000000 = 62.50%
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'
entry:
- %val = call i32 @strcmp(i8* %p, i8* %q)
+ %val = call i32 @strcmp(ptr %p, ptr %q)
%cond = icmp sgt i32 %val, 0
br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x40000000 / 0x80000000 = 50.00%
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'
entry:
- %val = call i32 @strcmp(i8* %p, i8* %q)
+ %val = call i32 @strcmp(ptr %p, ptr %q)
%cond = icmp slt i32 %val, 0
br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x40000000 / 0x80000000 = 50.00%
; 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'
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
br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x40000000 / 0x80000000 = 50.00%
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'
entry:
- %val = call i32 @strcasecmp(i8* %p, i8* %q)
+ %val = call i32 @strcasecmp(ptr %p, ptr %q)
%cond = icmp sgt i32 %val, 0
br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x40000000 / 0x80000000 = 50.00%
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'
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
br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x40000000 / 0x80000000 = 50.00%
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'
entry:
- %val = call i32 @memcmp(i8* %p, i8* %q)
+ %val = call i32 @memcmp(ptr %p, ptr %q)
%cond = icmp sgt i32 %val, 0
br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x40000000 / 0x80000000 = 50.00%
; heuristic is applied, i.e. positive more likely than negative, nonzero more
; 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'
entry:
- %val = call i32 @nonstrcmp(i8* %p, i8* %q)
+ %val = call i32 @nonstrcmp(ptr %p, ptr %q)
%cond = icmp eq i32 %val, 0
br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x30000000 / 0x80000000 = 37.50%
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'
entry:
- %val = call i32 @nonstrcmp(i8* %p, i8* %q)
+ %val = call i32 @nonstrcmp(ptr %p, ptr %q)
%cond = icmp ne i32 %val, 0
br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x50000000 / 0x80000000 = 62.50%
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'
entry:
- %val = call i32 @nonstrcmp(i8* %p, i8* %q)
+ %val = call i32 @nonstrcmp(ptr %p, ptr %q)
%cond = icmp sgt i32 %val, 0
br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x50000000 / 0x80000000 = 62.50%
}
-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'
entry:
- %val = call i32 @bcmp(i8* %p, i8* %q)
+ %val = call i32 @bcmp(ptr %p, ptr %q)
%cond = icmp eq i32 %val, 0
br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x30000000 / 0x80000000 = 37.50%
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'
entry:
- %val = call i32 @bcmp(i8* %p, i8* %q)
+ %val = call i32 @bcmp(ptr %p, ptr %q)
%cond = icmp eq i32 %val, 5
br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x30000000 / 0x80000000 = 37.50%
-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'
entry:
- %val = call i32 @bcmp(i8* %p, i8* %q)
+ %val = call i32 @bcmp(ptr %p, ptr %q)
%cond = icmp ne i32 %val, 0
br i1 %cond, label %then, label %else
; CHECK: edge entry -> then probability is 0x50000000 / 0x80000000 = 62.50%
ret void
}
-define void @test3(i32 %a, i32 %b, i32* %c) {
+define void @test3(i32 %a, i32 %b, ptr %c) {
entry:
br label %do.body
; CHECK: edge entry -> do.body probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
do.body:
%i.0 = phi i32 [ 0, %entry ], [ %inc4, %if.end ]
call void @g1()
- %0 = load i32, i32* %c, align 4
+ %0 = load i32, ptr %c, align 4
%cmp = icmp slt i32 %0, 42
br i1 %cmp, label %do.body1, label %if.end
; CHECK: edge do.body -> do.body1 probability is 0x40000000 / 0x80000000 = 50.00%
ret void
}
-define void @test4(i32 %a, i32 %b, i32* %c) {
+define void @test4(i32 %a, i32 %b, ptr %c) {
entry:
br label %do.body
; CHECK: edge entry -> do.body probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
do.body:
%i.0 = phi i32 [ 0, %entry ], [ %inc4, %do.end ]
call void @g1()
- %0 = load i32, i32* %c, align 4
+ %0 = load i32, ptr %c, align 4
%cmp = icmp slt i32 %0, 42
br i1 %cmp, label %return, label %do.body1
; CHECK: edge do.body -> return probability is 0x04000000 / 0x80000000 = 3.12%
ret void
}
-define void @test5(i32 %a, i32 %b, i32* %c) {
+define void @test5(i32 %a, i32 %b, ptr %c) {
entry:
br label %do.body
; CHECK: edge entry -> do.body probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
do.body1:
%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
br i1 %cmp, label %return, label %if.end
; CHECK: edge do.body1 -> return probability is 0x04000000 / 0x80000000 = 3.12%
ret void
}
-define void @test6(i32 %a, i32 %b, i32* %c) {
+define void @test6(i32 %a, i32 %b, ptr %c) {
entry:
br label %do.body
; CHECK: edge entry -> do.body probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
do.body1:
%j.0 = phi i32 [ 0, %do.body ], [ %inc, %do.cond ]
call void @g2()
- %0 = load i32, i32* %c, align 4
+ %0 = load i32, ptr %c, align 4
%cmp = icmp slt i32 %0, 42
br i1 %cmp, label %return, label %do.cond
; CHECK: edge do.body1 -> return probability is 0x04000000 / 0x80000000 = 3.12%
ret void
}
-define void @test7(i32 %a, i32 %b, i32* %c) {
+define void @test7(i32 %a, i32 %b, ptr %c) {
entry:
%cmp10 = icmp sgt i32 %a, 0
br i1 %cmp10, label %for.body.lr.ph, label %for.end7
for.body:
%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
br i1 %cmp1, label %for.inc5, label %if.end
; CHECK: edge for.body -> for.inc5 probability is 0x40000000 / 0x80000000 = 50.00%
ret void
}
-define void @test8(i32 %a, i32 %b, i32* %c) {
+define void @test8(i32 %a, i32 %b, ptr %c) {
entry:
%cmp18 = icmp sgt i32 %a, 0
br i1 %cmp18, label %for.body.lr.ph, label %for.end15
for.body.lr.ph:
%cmp216 = icmp sgt i32 %b, 0
- %arrayidx5 = getelementptr inbounds i32, i32* %c, i64 1
- %arrayidx9 = getelementptr inbounds i32, i32* %c, i64 2
+ %arrayidx5 = getelementptr inbounds i32, ptr %c, i64 1
+ %arrayidx9 = getelementptr inbounds i32, ptr %c, i64 2
br label %for.body
; CHECK: edge for.body.lr.ph -> for.body probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
for.body3:
%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
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 -> if.end probability is 0x40000000 / 0x80000000 = 50.00%
if.end:
- %1 = load i32, i32* %arrayidx5, align 4
+ %1 = load i32, ptr %arrayidx5, align 4
%cmp6 = icmp eq i32 %1, %j.017
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 -> if.end8 probability is 0x40000000 / 0x80000000 = 50.00%
if.end8:
- %2 = load i32, i32* %arrayidx9, align 4
+ %2 = load i32, ptr %arrayidx9, align 4
%cmp10 = icmp eq i32 %2, %j.017
br i1 %cmp10, label %for.inc, label %if.end12
; CHECK: edge if.end8 -> for.inc probability is 0x40000000 / 0x80000000 = 50.00%
; 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.
-define i32 @test10(i32 %n, i32* %p) {
+define i32 @test10(i32 %n, ptr %p) {
entry:
br label %for.cond
; CHECK: edge entry -> for.cond probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
ret i32 %sum.0
for.body:
- %arrayidx = getelementptr inbounds i32, i32* %p, i32 %i.0
- %0 = load i32, i32* %arrayidx, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %p, i32 %i.0
+ %0 = load i32, ptr %arrayidx, align 4
%add = add nsw i32 %sum.0, %0
%inc = add nsw i32 %count.0, 1
%cmp1 = icmp sgt i32 %count.0, 6
; CHECK: edge for.body -> if.then probability is 0x2aaaa8e4 / 0x80000000 = 33.33%
; CHECK: edge for.body -> for.inc probability is 0x5555571c / 0x80000000 = 66.67%
if.then:
- store i32 %add, i32* %arrayidx, align 4
+ store i32 %add, ptr %arrayidx, align 4
br label %for.inc
; CHECK: edge if.then -> for.inc probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
; Each successor to for.body makes itself not be taken in the next iteration, so
; both should be equally likely
-define i32 @test11(i32 %n, i32* %p) {
+define i32 @test11(i32 %n, ptr %p) {
entry:
br label %for.cond
; CHECK: edge entry -> for.cond probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
for.body:
%tobool = icmp eq i32 %flip.0, 0
- %arrayidx1 = getelementptr inbounds i32, i32* %p, i32 %i.0
- %0 = load i32, i32* %arrayidx1, align 4
+ %arrayidx1 = getelementptr inbounds i32, ptr %p, i32 %i.0
+ %0 = load i32, ptr %arrayidx1, align 4
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.then probability is 0x40000000 / 0x80000000 = 50.00%
if.then:
%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
; CHECK: edge if.then -> for.inc probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
; CHECK: edge invoke.cont -> exit probability is 0x04000000 / 0x80000000 = 3.12%
lpad:
- %ll = landingpad { i8*, i32 }
+ %ll = landingpad { ptr, i32 }
cleanup
br label %exit
ret i32 %b
}
-@_ZTIi = external global i8*
+@_ZTIi = external global ptr
; CHECK-LABEL: throwSmallException
; 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:
%cmp = icmp sge i32 %idx, %limit
br i1 %cmp, label %if.then, label %if.end
; CHECK: edge entry -> if.end probability is 0x7ffff800 / 0x80000000 = 100.00% [HOT edge]
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)
to label %invoke.cont unwind label %lpad
; CHECK: edge if.then -> invoke.cont probability is 0x40000000 / 0x80000000 = 50.00%
; CHECK: edge if.then -> lpad probability is 0x40000000 / 0x80000000 = 50.00%
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
lpad: ; preds = %if.then
- %ll = landingpad { i8*, i32 }
+ %ll = landingpad { ptr, i32 }
cleanup
ret i32 %idx
@a = global i32 4
define i32 @smallFunction(i32 %a) {
entry:
- %r = load volatile i32, i32* @a
+ %r = load volatile i32, ptr @a
ret i32 %r
}
attributes #0 = { nounwind }
attributes #1 = { noreturn }
-declare i8* @__cxa_allocate_exception(i64)
+declare ptr @__cxa_allocate_exception(i64)
declare i32 @__gxx_personality_v0(...)
-declare void @__cxa_throw(i8*, i8*, i8*)
+declare void @__cxa_throw(ptr, ptr, ptr)
; 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':
- %3 = icmp eq i32* %0, %1
+ %3 = icmp eq ptr %0, %1
br i1 %3, label %4, label %6
; CHECK: edge -> probability is 0x30000000 / 0x80000000 = 37.50%
; CHECK: edge -> probability is 0x50000000 / 0x80000000 = 62.50%
4: ; preds = %2
- %5 = tail call i32 bitcast (i32 (...)* @f to i32 ()*)() #2
+ %5 = tail call i32 @f() #2
br label %8
; CHECK: edge -> probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
6: ; preds = %2
- %7 = tail call i32 bitcast (i32 (...)* @g to i32 ()*)() #2
+ %7 = tail call i32 @g() #2
br label %8
; CHECK: edge -> probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
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':
- %3 = icmp eq i32* %0, %1
+ %3 = icmp eq ptr %0, %1
br i1 %3, label %6, label %4
; CHECK: edge -> probability is 0x30000000 / 0x80000000 = 37.50%
; CHECK: edge -> probability is 0x50000000 / 0x80000000 = 62.50%
4: ; preds = %2
- %5 = tail call i32 bitcast (i32 (...)* @f to i32 ()*)() #2
+ %5 = tail call i32 @f() #2
br label %8
; CHECK: edge -> probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
6: ; preds = %2
- %7 = tail call i32 bitcast (i32 (...)* @g to i32 ()*)() #2
+ %7 = tail call i32 @g() #2
br label %8
; CHECK: edge -> probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
}
; CHECK: Printing analysis results of BPI for function 'cmp3':
-define i32 @cmp3(i32* readnone %0) {
- %2 = icmp eq i32* %0, null
+define i32 @cmp3(ptr readnone %0) {
+ %2 = icmp eq ptr %0, null
br i1 %2, label %3, label %5
; CHECK: edge -> probability is 0x30000000 / 0x80000000 = 37.50%
; CHECK: edge -> probability is 0x50000000 / 0x80000000 = 62.50%
3: ; preds = %1
- %4 = tail call i32 bitcast (i32 (...)* @f to i32 ()*)() #2
+ %4 = tail call i32 @f() #2
br label %7
; CHECK: edge -> probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
5: ; preds = %1
- %6 = tail call i32 bitcast (i32 (...)* @g to i32 ()*)() #2
+ %6 = tail call i32 @g() #2
br label %7
; CHECK: edge -> probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
; CHECK: edge while.body -> if.then probability is 0x50000000 / 0x80000000 = 62.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:
%tobool8 = icmp eq i32 %n, 0
br i1 %tobool8, label %while.end, label %while.body.lr.ph
while.body:
%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 ]
- %d.addr.010 = phi i32* [ %d, %while.body.lr.ph ], [ %incdec.ptr4, %if.end ]
- %c.addr.09 = phi i32* [ %c, %while.body.lr.ph ], [ %c.addr.1, %if.end ]
+ %b.addr.011 = phi ptr [ %b, %while.body.lr.ph ], [ %b.addr.1, %if.end ]
+ %d.addr.010 = phi ptr [ %d, %while.body.lr.ph ], [ %incdec.ptr4, %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
- %arrayidx = getelementptr inbounds float, float* %f0, i64 %indvars.iv.next
- %1 = load float, float* %arrayidx, align 4
- %arrayidx2 = getelementptr inbounds float, float* %f1, i64 %indvars.iv.next
- %2 = load float, float* %arrayidx2, align 4
+ %arrayidx = getelementptr inbounds float, ptr %f0, i64 %indvars.iv.next
+ %1 = load float, ptr %arrayidx, align 4
+ %arrayidx2 = getelementptr inbounds float, ptr %f1, i64 %indvars.iv.next
+ %2 = load float, ptr %arrayidx2, align 4
%cmp = fcmp une float %1, %2
br i1 %cmp, label %if.then, label %if.else
if.then:
- %incdec.ptr = getelementptr inbounds i32, i32* %b.addr.011, i64 1
- %3 = load i32, i32* %b.addr.011, align 4
+ %incdec.ptr = getelementptr inbounds i32, ptr %b.addr.011, i64 1
+ %3 = load i32, ptr %b.addr.011, align 4
%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
if.else:
- %incdec.ptr3 = getelementptr inbounds i32, i32* %c.addr.09, i64 1
- %4 = load i32, i32* %c.addr.09, align 4
+ %incdec.ptr3 = getelementptr inbounds i32, ptr %c.addr.09, i64 1
+ %4 = load i32, ptr %c.addr.09, align 4
%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
if.end:
- %c.addr.1 = phi i32* [ %c.addr.09, %if.then ], [ %incdec.ptr3, %if.else ]
- %b.addr.1 = phi i32* [ %incdec.ptr, %if.then ], [ %b.addr.011, %if.else ]
- %incdec.ptr4 = getelementptr inbounds i32, i32* %d.addr.010, i64 1
- store i32 14, i32* %d.addr.010, align 4
+ %c.addr.1 = phi ptr [ %c.addr.09, %if.then ], [ %incdec.ptr3, %if.else ]
+ %b.addr.1 = phi ptr [ %incdec.ptr, %if.then ], [ %b.addr.011, %if.else ]
+ %incdec.ptr4 = getelementptr inbounds i32, ptr %d.addr.010, i64 1
+ store i32 14, ptr %d.addr.010, align 4
%5 = trunc i64 %indvars.iv.next to i32
%tobool = icmp eq i32 %5, 0
br i1 %tobool, label %while.end, label %while.body
entry:
%retval = alloca i32, align 4
%i = alloca i64, align 8
- store i32 0, i32* %retval
- store i64 0, i64* @y, align 8
- store i64 0, i64* @x, align 8
+ store i32 0, ptr %retval
+ store i64 0, ptr @y, align 8
+ store i64 0, ptr @x, align 8
call void @srand(i32 422304) #3
- store i64 0, i64* %i, align 8
+ store i64 0, ptr %i, align 8
br label %for.cond
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
br i1 %cmp, label %for.body, label %for.end, !prof !1
br i1 %cmp1, label %if.then, label %if.else, !prof !2
if.then: ; preds = %for.body
- %1 = load i64, i64* @x, align 8
+ %1 = load i64, ptr @x, align 8
%inc = add i64 %1, 1
- store i64 %inc, i64* @x, align 8
+ store i64 %inc, ptr @x, align 8
br label %if.end
if.else: ; preds = %for.body
- %2 = load i64, i64* @y, align 8
+ %2 = load i64, ptr @y, align 8
%inc3 = add i64 %2, 1
- store i64 %inc3, i64* @y, align 8
+ store i64 %inc3, ptr @y, align 8
br label %if.end
if.end: ; preds = %if.else, %if.then
br label %for.inc
for.inc: ; preds = %if.end
- %3 = load i64, i64* %i, align 8
+ %3 = load i64, ptr %i, align 8
%inc4 = add i64 %3, 1
- store i64 %inc4, i64* %i, align 8
+ store i64 %inc4, ptr %i, align 8
br label %for.cond
for.end: ; preds = %for.cond
- %4 = load i64, i64* @x, align 8
- %5 = load i64, i64* @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)
+ %4 = load i64, ptr @x, align 8
+ %5 = load i64, ptr @y, align 8
+ %call5 = call i32 (ptr, ...) @printf(ptr @.str, i64 %4, i64 %5)
ret i32 0
}
; Function Attrs: nounwind
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 #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" }
@B = global i32 0, align 4
; CHECK-LABEL: eq_opaque_minus_one
-define void @eq_opaque_minus_one(i32* %base) {
+define void @eq_opaque_minus_one(ptr %base) {
entry:
%const = bitcast i32 -1 to i32
- %tmp1 = load i32, i32* @B, align 4
+ %tmp1 = load i32, ptr @B, align 4
br label %for.body
; CHECK: edge for.body -> if.then probability is 0x30000000 / 0x80000000 = 37.50%
for.body:
%tmp4 = phi i32 [ %tmp1, %entry ], [ %tmp7, %for.inc ]
%inc.iv = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
- %storemerge176.in = getelementptr inbounds i32, i32* %base, i32 %inc.iv
- %storemerge176 = load i32, i32* %storemerge176.in, align 4
- store i32 %storemerge176, i32* @A, align 4
+ %storemerge176.in = getelementptr inbounds i32, ptr %base, i32 %inc.iv
+ %storemerge176 = load i32, ptr %storemerge176.in, align 4
+ store i32 %storemerge176, ptr @A, align 4
%cmp20 = icmp eq i32 %storemerge176, %const
br i1 %cmp20, label %if.then, label %for.inc
if.then:
%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
for.inc:
}
; CHECK-LABEL: ne_opaque_minus_one
-define void @ne_opaque_minus_one(i32* %base) {
+define void @ne_opaque_minus_one(ptr %base) {
entry:
%const = bitcast i32 -1 to i32
- %tmp1 = load i32, i32* @B, align 4
+ %tmp1 = load i32, ptr @B, align 4
br label %for.body
; CHECK: edge for.body -> if.then probability is 0x50000000 / 0x80000000 = 62.50%
for.body:
%tmp4 = phi i32 [ %tmp1, %entry ], [ %tmp7, %for.inc ]
%inc.iv = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
- %storemerge176.in = getelementptr inbounds i32, i32* %base, i32 %inc.iv
- %storemerge176 = load i32, i32* %storemerge176.in, align 4
- store i32 %storemerge176, i32* @A, align 4
+ %storemerge176.in = getelementptr inbounds i32, ptr %base, i32 %inc.iv
+ %storemerge176 = load i32, ptr %storemerge176.in, align 4
+ store i32 %storemerge176, ptr @A, align 4
%cmp20 = icmp ne i32 %storemerge176, %const
br i1 %cmp20, label %if.then, label %for.inc
if.then:
%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
for.inc:
}
; CHECK-LABEL: sgt_opaque_minus_one
-define void @sgt_opaque_minus_one(i32* %base) {
+define void @sgt_opaque_minus_one(ptr %base) {
entry:
%const = bitcast i32 -1 to i32
- %tmp1 = load i32, i32* @B, align 4
+ %tmp1 = load i32, ptr @B, align 4
br label %for.body
; CHECK: edge for.body -> if.then probability is 0x50000000 / 0x80000000 = 62.50%
for.body:
%tmp4 = phi i32 [ %tmp1, %entry ], [ %tmp7, %for.inc ]
%inc.iv = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
- %storemerge176.in = getelementptr inbounds i32, i32* %base, i32 %inc.iv
- %storemerge176 = load i32, i32* %storemerge176.in, align 4
- store i32 %storemerge176, i32* @A, align 4
+ %storemerge176.in = getelementptr inbounds i32, ptr %base, i32 %inc.iv
+ %storemerge176 = load i32, ptr %storemerge176.in, align 4
+ store i32 %storemerge176, ptr @A, align 4
%cmp20 = icmp sgt i32 %storemerge176, %const
br i1 %cmp20, label %if.then, label %for.inc
if.then:
%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
for.inc:
define void @caller() {
entry:
- call void (...) @callee( void (...)* @callee )
+ call void (...) @callee( ptr @callee )
unreachable
}
; 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-NEXT: CS<{{.*}}> calls function 'broker'
; CHECK-NEXT: CS<None> calls function 'callback'
-define void @caller(i32* %arg) {
- call void @broker(void (i32*)* @callback, i32* %arg)
+define void @caller(ptr %arg) {
+ call void @broker(ptr @callback, ptr %arg)
ret void
}
-define void @callback(i32* %arg) {
+define void @callback(ptr %arg) {
ret void
}
-declare !callback !0 void @broker(void (i32*)*, i32*)
+declare !callback !0 void @broker(ptr, ptr)
!0 = !{!1}
!1 = !{i64 0, i64 1, i1 false}
; CHECK-NEXT: CS<{{.*}}> calls function '__kmpc_fork_call'
; 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
-@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
define dso_local void @f() {
br label %omp_parallel
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
omp.par.exit.split: ; preds = %omp_parallel
}
; 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:
%tid.addr.local = alloca i32, align 4
- %0 = load i32, i32* %tid.addr, align 4
- store i32 %0, i32* %tid.addr.local, align 4
- %tid = load i32, i32* %tid.addr.local, align 4
+ %0 = load i32, ptr %tid.addr, align 4
+ store i32 %0, ptr %tid.addr.local, align 4
+ %tid = load i32, ptr %tid.addr.local, align 4
br label %omp.par.region
omp.par.exit.split.exitStub: ; preds = %omp.par.outlined.exit
}
; 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}
!3 = !{i64 2, i64 -1, i64 -1, i1 true}
; CHECK-NEXT: Call graph node for function: 'used2'<<{{.*}}>> #uses=1
; CHECK-EMPTY:
-@llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @used1 to i8*)]
-@llvm.compiler.used = appending global [1 x void()*] [void ()* @used2]
-@array = appending global [1 x i8*] [i8* bitcast (void ()* @unused to i8*)]
+@llvm.used = appending global [1 x ptr] [ptr @used1]
+@llvm.compiler.used = appending global [1 x ptr] [ptr @used2]
+@array = appending global [1 x ptr] [ptr @unused]
define internal void @used1() {
entry:
; 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) {
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %out, i8* align 4 %in, i32 100, i1 false)
+define void @f(ptr %out, ptr %in) {
+ call void @llvm.memcpy.p0.p0.i32(ptr align 4 %out, ptr align 4 %in, i32 100, i1 false)
ret void
}
; RUN: opt -S -print-callgraph -disable-output < %s 2>&1 | FileCheck %s
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() {
ret void
define void @calls_statepoint(ptr addrspace(1) %arg) gc "statepoint-example" {
entry:
%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
}
; CHECK: Node Address:[[N4]]:single-instruction
; 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: [def-use] to [[N6:0x[0-9a-f]*]]
; CHECK: Node Address:[[N3]]:multi-instruction
; CHECK-NEXT: Instructions:
-; CHECK-NEXT: %arrayidx = getelementptr inbounds float, float* %b, i64 %i.02
-; CHECK-NEXT: %0 = load float, float* %arrayidx, align 4
+; CHECK-NEXT: %arrayidx = getelementptr inbounds float, ptr %b, i64 %i.02
+; CHECK-NEXT: %0 = load float, ptr %arrayidx, align 4
; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N7:0x[0-9a-f]*]]
; CHECK: Node Address:[[N6]]:single-instruction
; 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!
;; 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++)
;; 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:
%exitcond1 = icmp ne i64 0, %n
br i1 %exitcond1, label %test1.for.body, label %for.end
test1.for.body: ; preds = %entry, %test1.for.body
%i.02 = phi i64 [ %inc, %test1.for.body ], [ 0, %entry ]
- %arrayidx = getelementptr inbounds float, float* %b, i64 %i.02
- %0 = load float, float* %arrayidx, align 4
+ %arrayidx = getelementptr inbounds float, ptr %b, i64 %i.02
+ %0 = load float, ptr %arrayidx, align 4
%conv = uitofp i64 %n to float
%add = fadd float %0, %conv
- %arrayidx1 = getelementptr inbounds float, float* %a, i64 %i.02
- store float %add, float* %arrayidx1, align 4
+ %arrayidx1 = getelementptr inbounds float, ptr %a, i64 %i.02
+ store float %add, ptr %arrayidx1, align 4
%inc = add i64 %i.02, 1
%exitcond = icmp ne i64 %inc, %n
br i1 %exitcond, label %test1.for.body, label %for.end
; CHECK: Node Address:[[N5]]:single-instruction
; 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: [def-use] to [[N7:0x[0-9a-f]*]]
; CHECK: Node Address:[[N4]]:multi-instruction
; CHECK-NEXT: Instructions:
-; CHECK-NEXT: %arrayidx1 = getelementptr inbounds float, float* %a, i64 %i.02
-; CHECK-NEXT: %1 = load float, float* %arrayidx1, align 4
+; CHECK-NEXT: %arrayidx1 = getelementptr inbounds float, ptr %a, i64 %i.02
+; CHECK-NEXT: %1 = load float, ptr %arrayidx1, align 4
; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N8:0x[0-9a-f]*]]
; CHECK-NEXT: [memory] to [[N7]]
; CHECK: Node Address:[[N3]]:multi-instruction
; CHECK-NEXT: Instructions:
-; CHECK-NEXT: %arrayidx = getelementptr inbounds float, float* %b, i64 %i.02
-; CHECK-NEXT: %0 = load float, float* %arrayidx, align 4
+; CHECK-NEXT: %arrayidx = getelementptr inbounds float, ptr %b, i64 %i.02
+; CHECK-NEXT: %0 = load float, ptr %arrayidx, align 4
; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N8]]
; CHECK: Node Address:[[N7]]:single-instruction
; 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!
;; 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++)
;; 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:
%exitcond1 = icmp ne i64 0, %n
br i1 %exitcond1, label %test2.for.body, label %for.end
test2.for.body: ; preds = %entry, %test2.for.body
%i.02 = phi i64 [ %inc, %test2.for.body ], [ 0, %entry ]
- %arrayidx = getelementptr inbounds float, float* %b, i64 %i.02
- %0 = load float, float* %arrayidx, align 4
- %arrayidx1 = getelementptr inbounds float, float* %a, i64 %i.02
- %1 = load float, float* %arrayidx1, align 4
+ %arrayidx = getelementptr inbounds float, ptr %b, i64 %i.02
+ %0 = load float, ptr %arrayidx, align 4
+ %arrayidx1 = getelementptr inbounds float, ptr %a, i64 %i.02
+ %1 = load float, ptr %arrayidx1, align 4
%add = fadd float %0, %1
- %arrayidx2 = getelementptr inbounds float, float* %a, i64 %i.02
- store float %add, float* %arrayidx2, align 4
+ %arrayidx2 = getelementptr inbounds float, ptr %a, i64 %i.02
+ store float %add, ptr %arrayidx2, align 4
%inc = add i64 %i.02, 1
%exitcond = icmp ne i64 %inc, %n
br i1 %exitcond, label %test2.for.body, label %for.end
; CHECK: Node Address:[[N6]]:single-instruction
; 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: [def-use] to [[N8:0x[0-9a-f]*]]
; CHECK: Node Address:[[N5]]:multi-instruction
; CHECK-NEXT: Instructions:
; 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: [def-use] to [[N8]]
; CHECK: Node Address:[[N4]]:multi-instruction
; CHECK-NEXT: Instructions:
-; CHECK-NEXT: %arrayidx = getelementptr inbounds float, float* %b, i64 %i.02
-; CHECK-NEXT: %0 = load float, float* %arrayidx, align 4
+; CHECK-NEXT: %arrayidx = getelementptr inbounds float, ptr %b, i64 %i.02
+; CHECK-NEXT: %0 = load float, ptr %arrayidx, align 4
; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N8]]
; CHECK-NEXT: --- start of nodes in pi-block ---
; CHECK: Node Address:[[N9:0x[0-9a-f]*]]:single-instruction
; 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: [def-use] to [[N10:0x[0-9a-f]*]]
; CHECK: Node Address:[[N11]]:single-instruction
; 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: [memory] to [[N9]]
; CHECK-NEXT:--- end of nodes in pi-block ---
;; Loop-carried dependence requiring edge-reversal to expose a cycle
;; 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++)
;; 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:
%sub = add i64 %n, -1
%cmp1 = icmp ult i64 1, %sub
test1.for.body: ; preds = %entry, %test1.for.body
%i.02 = phi i64 [ %inc, %test1.for.body ], [ 1, %entry ]
- %arrayidx = getelementptr inbounds float, float* %b, i64 %i.02
- %0 = load float, float* %arrayidx, align 4
+ %arrayidx = getelementptr inbounds float, ptr %b, i64 %i.02
+ %0 = load float, ptr %arrayidx, align 4
%sub1 = add i64 %i.02, -1
- %arrayidx2 = getelementptr inbounds float, float* %a, i64 %sub1
- %1 = load float, float* %arrayidx2, align 4
+ %arrayidx2 = getelementptr inbounds float, ptr %a, i64 %sub1
+ %1 = load float, ptr %arrayidx2, align 4
%add = fadd float %0, %1
- %arrayidx3 = getelementptr inbounds float, float* %a, i64 %i.02
- store float %add, float* %arrayidx3, align 4
+ %arrayidx3 = getelementptr inbounds float, ptr %a, i64 %i.02
+ store float %add, ptr %arrayidx3, align 4
%inc = add i64 %i.02, 1
%cmp = icmp ult i64 %inc, %sub
br i1 %cmp, label %test1.for.body, label %for.end
; CHECK: Node Address:[[N6]]:single-instruction
; 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: [def-use] to [[N8:0x[0-9a-f]*]]
; CHECK: Node Address:[[N5]]:multi-instruction
; CHECK-NEXT: Instructions:
; CHECK-NEXT: %add1 = add i64 %i.02, 1
-; CHECK-NEXT: %arrayidx2 = getelementptr inbounds float, float* %a, i64 %add1
-; CHECK-NEXT: %1 = load float, float* %arrayidx2, align 4
+; CHECK-NEXT: %arrayidx2 = getelementptr inbounds float, ptr %a, i64 %add1
+; CHECK-NEXT: %1 = load float, ptr %arrayidx2, align 4
; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N9:0x[0-9a-f]*]]
; CHECK-NEXT: [memory] to [[N8]]
; CHECK: Node Address:[[N4]]:multi-instruction
; CHECK-NEXT: Instructions:
-; CHECK-NEXT: %arrayidx = getelementptr inbounds float, float* %b, i64 %i.02
-; CHECK-NEXT: %0 = load float, float* %arrayidx, align 4
+; CHECK-NEXT: %arrayidx = getelementptr inbounds float, ptr %b, i64 %i.02
+; CHECK-NEXT: %0 = load float, ptr %arrayidx, align 4
; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N9]]
; CHECK: Node Address:[[N8]]:single-instruction
; 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!
;; 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++)
;; 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:
%sub = add i64 %n, -1
%cmp1 = icmp ult i64 1, %sub
test2.for.body: ; preds = %entry, %test2.for.body
%i.02 = phi i64 [ %inc, %test2.for.body ], [ 1, %entry ]
- %arrayidx = getelementptr inbounds float, float* %b, i64 %i.02
- %0 = load float, float* %arrayidx, align 4
+ %arrayidx = getelementptr inbounds float, ptr %b, i64 %i.02
+ %0 = load float, ptr %arrayidx, align 4
%add1 = add i64 %i.02, 1
- %arrayidx2 = getelementptr inbounds float, float* %a, i64 %add1
- %1 = load float, float* %arrayidx2, align 4
+ %arrayidx2 = getelementptr inbounds float, ptr %a, i64 %add1
+ %1 = load float, ptr %arrayidx2, align 4
%add = fadd float %0, %1
- %arrayidx3 = getelementptr inbounds float, float* %a, i64 %i.02
- store float %add, float* %arrayidx3, align 4
+ %arrayidx3 = getelementptr inbounds float, ptr %a, i64 %i.02
+ store float %add, ptr %arrayidx3, align 4
%inc = add i64 %i.02, 1
%cmp = icmp ult i64 %inc, %sub
br i1 %cmp, label %test2.for.body, label %for.end
; CHECK: Node Address:[[N14]]:multi-instruction
; CHECK-NEXT: Instructions:
; 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: [def-use] to [[N6]]
; CHECK: Node Address:[[N6]]:single-instruction
; 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: [def-use] to [[N18:0x[0-9a-f]*]]
; CHECK: Node Address:[[N13]]:multi-instruction
; CHECK-NEXT: Instructions:
; 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: [def-use] to [[N8]]
; CHECK: Node Address:[[N8]]:single-instruction
; 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: [def-use] to [[N18]]
; CHECK: Node Address:[[N12]]:multi-instruction
; CHECK-NEXT: Instructions:
; 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: [def-use] to [[N4]]
; CHECK: Node Address:[[N4]]:multi-instruction
; CHECK-NEXT: Instructions:
-; CHECK-NEXT: %arrayidx5 = getelementptr inbounds float, float* %arrayidx, i64 %j.02
-; CHECK-NEXT: %1 = load float, float* %arrayidx5, align 4
+; CHECK-NEXT: %arrayidx5 = getelementptr inbounds float, ptr %arrayidx, i64 %j.02
+; CHECK-NEXT: %1 = load float, ptr %arrayidx5, align 4
; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N18]]
; CHECK-NEXT:--- start of nodes in pi-block ---
; CHECK: Node Address:[[N22:0x[0-9a-f]*]]:single-instruction
; 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: [def-use] to [[N23:0x[0-9a-f]*]]
; CHECK: Node Address:[[N24]]:single-instruction
; 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: [memory] to [[N22]]
; CHECK-NEXT:--- end of nodes in pi-block ---
;; 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:
%exitcond3 = icmp ne i64 0, %n
br i1 %exitcond3, label %test1.for.cond1.preheader, label %for.end14
for.body4: ; preds = %test1.for.cond1.preheader, %for.body4
%j.02 = phi i64 [ %inc, %for.body4 ], [ 1, %test1.for.cond1.preheader ]
%0 = mul nsw i64 %i.04, %n
- %arrayidx = getelementptr inbounds float, float* %b, i64 %0
- %arrayidx5 = getelementptr inbounds float, float* %arrayidx, i64 %j.02
- %1 = load float, float* %arrayidx5, align 4
+ %arrayidx = getelementptr inbounds float, ptr %b, i64 %0
+ %arrayidx5 = getelementptr inbounds float, ptr %arrayidx, i64 %j.02
+ %1 = load float, ptr %arrayidx5, align 4
%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
- %arrayidx8 = getelementptr inbounds float, float* %arrayidx6, i64 %sub7
- %3 = load float, float* %arrayidx8, align 4
+ %arrayidx8 = getelementptr inbounds float, ptr %arrayidx6, i64 %sub7
+ %3 = load float, ptr %arrayidx8, align 4
%add = fadd float %1, %3
%4 = mul nsw i64 %i.04, %n
- %arrayidx10 = getelementptr inbounds float, float* %a, i64 %4
- %arrayidx11 = getelementptr inbounds float, float* %arrayidx10, i64 %j.02
- store float %add, float* %arrayidx11, align 4
+ %arrayidx10 = getelementptr inbounds float, ptr %a, i64 %4
+ %arrayidx11 = getelementptr inbounds float, ptr %arrayidx10, i64 %j.02
+ store float %add, ptr %arrayidx11, align 4
%inc = add i64 %j.02, 1
%cmp2 = icmp ult i64 %inc, %sub
br i1 %cmp2, label %for.body4, label %for.inc12
; CHECK: Node Address:[[N13]]:multi-instruction
; CHECK-NEXT: Instructions:
; 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: [def-use] to [[N5]]
; CHECK: Node Address:[[N5]]:single-instruction
; 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: [def-use] to [[N17:0x[0-9a-f]*]]
; CHECK: Node Address:[[N12]]:multi-instruction
; CHECK-NEXT: Instructions:
; 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: [def-use] to [[N7]]
; CHECK: Node Address:[[N7]]:multi-instruction
; CHECK-NEXT: Instructions:
-; CHECK-NEXT: %arrayidx8 = getelementptr inbounds float, float* %arrayidx6, i64 %add7
-; CHECK-NEXT: %3 = load float, float* %arrayidx8, align 4
+; CHECK-NEXT: %arrayidx8 = getelementptr inbounds float, ptr %arrayidx6, i64 %add7
+; CHECK-NEXT: %3 = load float, ptr %arrayidx8, align 4
; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N20:0x[0-9a-f]*]]
; CHECK-NEXT: [memory] to [[N17]]
; CHECK: Node Address:[[N11]]:multi-instruction
; CHECK-NEXT: Instructions:
; 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: [def-use] to [[N3]]
; CHECK: Node Address:[[N3]]:multi-instruction
; CHECK-NEXT: Instructions:
-; CHECK-NEXT: %arrayidx5 = getelementptr inbounds float, float* %arrayidx, i64 %j.02
-; CHECK-NEXT: %1 = load float, float* %arrayidx5, align 4
+; CHECK-NEXT: %arrayidx5 = getelementptr inbounds float, ptr %arrayidx, i64 %j.02
+; CHECK-NEXT: %1 = load float, ptr %arrayidx5, align 4
; CHECK-NEXT: Edges:
; CHECK-NEXT: [def-use] to [[N20]]
; CHECK: Node Address:[[N17]]:single-instruction
; 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: Node Address:[[N23:0x[0-9a-f]*]]:single-instruction
;; 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:
%exitcond3 = icmp ne i64 0, %n
br i1 %exitcond3, label %test2.for.cond1.preheader, label %for.end14
for.body4: ; preds = %test2.for.cond1.preheader, %for.body4
%j.02 = phi i64 [ %inc, %for.body4 ], [ 1, %test2.for.cond1.preheader ]
%0 = mul nsw i64 %i.04, %n
- %arrayidx = getelementptr inbounds float, float* %b, i64 %0
- %arrayidx5 = getelementptr inbounds float, float* %arrayidx, i64 %j.02
- %1 = load float, float* %arrayidx5, align 4
+ %arrayidx = getelementptr inbounds float, ptr %b, i64 %0
+ %arrayidx5 = getelementptr inbounds float, ptr %arrayidx, i64 %j.02
+ %1 = load float, ptr %arrayidx5, align 4
%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
- %arrayidx8 = getelementptr inbounds float, float* %arrayidx6, i64 %add7
- %3 = load float, float* %arrayidx8, align 4
+ %arrayidx8 = getelementptr inbounds float, ptr %arrayidx6, i64 %add7
+ %3 = load float, ptr %arrayidx8, align 4
%add = fadd float %1, %3
%4 = mul nsw i64 %i.04, %n
- %arrayidx10 = getelementptr inbounds float, float* %a, i64 %4
- %arrayidx11 = getelementptr inbounds float, float* %arrayidx10, i64 %j.02
- store float %add, float* %arrayidx11, align 4
+ %arrayidx10 = getelementptr inbounds float, ptr %a, i64 %4
+ %arrayidx11 = getelementptr inbounds float, ptr %arrayidx10, i64 %j.02
+ store float %add, ptr %arrayidx11, align 4
%inc = add i64 %j.02, 1
%cmp2 = icmp ult i64 %inc, %sub
br i1 %cmp2, label %for.body4, label %for.inc12
; printed properly and that multiple memory dependencies on a single edge
; 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++) {
; A[i] = A[i] + B[i];
; B[i+1] = A[i] + 1;
; CHECK: {{Node0x.*}} -> {{Node0x.*}}[label="[rooted]"]
; CHECK-COUNT-6: {{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: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: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, 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: [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-NEXT: label="DDG for 'foo.for.body'";
; CHECK-ONLY: [shape=record,label="{pi-block\nwith\n2 nodes\n}"];
; CHECK-ONLY-COUNT-6: {{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="{ %arrayidx = getelementptr inbounds float, float* %A, i64 %indvars.iv\n %0 = load float, float* %arrayidx, align 4\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, ptr %A, i64 %indvars.iv\n %0 = load float, ptr %arrayidx, align 4\n}"];
; CHECK-ONLY: {{Node0x.*}} -> {{Node0x.*}}[label="[memory]"]
; 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:
%cmp1 = icmp sgt i32 %n, 0
br i1 %cmp1, label %for.body.preheader, label %for.end
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
- %arrayidx = getelementptr inbounds float, float* %A, i64 %indvars.iv
- %0 = load float, float* %arrayidx, align 4
- %arrayidx2 = getelementptr inbounds float, float* %B, i64 %indvars.iv
- %1 = load float, float* %arrayidx2, align 4
+ %arrayidx = getelementptr inbounds float, ptr %A, i64 %indvars.iv
+ %0 = load float, ptr %arrayidx, align 4
+ %arrayidx2 = getelementptr inbounds float, ptr %B, i64 %indvars.iv
+ %1 = load float, ptr %arrayidx2, align 4
%add = fadd fast float %0, %1
- %arrayidx4 = getelementptr inbounds float, float* %A, i64 %indvars.iv
- store float %add, float* %arrayidx4, align 4
- %arrayidx6 = getelementptr inbounds float, float* %A, i64 %indvars.iv
- %2 = load float, float* %arrayidx6, align 4
+ %arrayidx4 = getelementptr inbounds float, ptr %A, i64 %indvars.iv
+ store float %add, ptr %arrayidx4, align 4
+ %arrayidx6 = getelementptr inbounds float, ptr %A, i64 %indvars.iv
+ %2 = load float, ptr %arrayidx6, align 4
%add7 = fadd fast float %2, 1.000000e+00
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
- %arrayidx10 = getelementptr inbounds float, float* %B, i64 %indvars.iv.next
- store float %add7, float* %arrayidx10, align 4
+ %arrayidx10 = getelementptr inbounds float, ptr %B, i64 %indvars.iv.next
+ store float %add7, ptr %arrayidx10, align 4
%exitcond = icmp ne i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond, label %for.body, label %for.end.loopexit
; 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.
-;; 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++) {
;; a[i1] = 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:
%cmp1 = icmp ult i64 0, %n
br i1 %cmp1, label %for.body.lr.ph, label %for.end
test1.for.body: ; preds = %for.body.lr.ph, %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 ]
- %arrayidx = getelementptr inbounds float, float* %a, i64 %i1.02
- store float 1.000000e+00, float* %arrayidx, align 4
- %arrayidx1 = getelementptr inbounds float, float* %b, i64 %i2.03
- store float -1.000000e+00, float* %arrayidx1, align 4
+ %arrayidx = getelementptr inbounds float, ptr %a, i64 %i1.02
+ store float 1.000000e+00, ptr %arrayidx, align 4
+ %arrayidx1 = getelementptr inbounds float, ptr %b, i64 %i2.03
+ store float -1.000000e+00, ptr %arrayidx1, align 4
%inc = add i64 %i1.02, 1
%inc2 = add i64 %i2.03, 1
%cmp = icmp ult i64 %inc, %n
}
; 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-NEXT: entry:
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: maybe_taken:
; CHECK-NOT: mustexec
; 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: backedge:
; CHECK-NEXT: [[IV_NEXT]] = add i32 [[IV]], 1 ; (mustexec in: loop)
maybe_taken:
%div = sdiv i32 %a, %b
- store i32 %div, i32* %p
+ store i32 %div, ptr %p
br i1 true, label %backedge, label %exit
backedge:
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; 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: 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-NOT: mustexec
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)
%iv.next = add nsw nuw i32 %iv, 1
%exit.test = icmp slt i32 %iv, %high
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: 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-NOT: mustexec
entry:
loop:
%iv = phi i32 [0, %entry], [%iv.next, %next]
- %v = load i32, i32* %p
+ %v = load i32, ptr %p
br label %next
next:
call void @maythrow_and_use(i32 %v)
; FIXME: everything in inner loop header should be must execute
; 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: loop: ; preds = %next
; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %next ] ; (mustexec in: loop)
; CHECK: br label %inner_loop ; (mustexec in: 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: br i1 %inner.test, label %inner_loop, label %next ; (mustexec in: inner_loop)
; CHECK-NOT: mustexec
br label %inner_loop
inner_loop:
- %v = load i32, i32* %p
+ %v = load i32, ptr %p
%inner.test = icmp eq i32 %v, 0
br i1 %inner.test, label %inner_loop, label %next
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: loop: ; preds = %next
; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %next ] ; (mustexec in: loop)
; CHECK: br label %inner_loop ; (mustexec in: 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: br i1 %inner.test, label %inner_loop, label %next ; (mustexec in 2 loops: inner_loop, loop)
; CHECK-LABEL: next:
br label %inner_loop
inner_loop:
- %v = load i32, i32* %p
+ %v = load i32, ptr %p
%inner.test = icmp eq i32 %v, 0
br i1 %inner.test, label %inner_loop, label %next
; Since all the instructions in the loop dominate the only exit
; and there's no implicit control flow in the loop, all must execute
; 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: loop:
; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %next ] ; (mustexec in: loop)
; CHECK: br label %next ; (mustexec in: loop)
; 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: %exit.test = icmp slt i32 %iv, %high ; (mustexec in: loop)
; CHECK: br i1 %exit.test, label %exit, label %loop ; (mustexec in: loop)
%iv = phi i32 [0, %entry], [%iv.next, %next]
br label %next
next:
- %v = load i32, i32* %p
+ %v = load i32, ptr %p
%iv.next = add nsw nuw i32 %iv, 1
%exit.test = icmp slt i32 %iv, %high
br i1 %exit.test, label %exit, label %loop
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-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: -- 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] %tmp3 = icmp eq i32 %b, 0
-; MBEC-NEXT: -- Explore context of: %tmp5 = tail call i32 @g(i32* nonnull %a)
-; MBEC-NEXT: [F: nonnull_exec_ctx_1] %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(ptr nonnull %a)
; 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] %tmp3 = icmp eq i32 %b, 0
; 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] %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] %tmp3 = icmp eq i32 %b, 0
; 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] 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] %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 %tmp3, label %ex, label %hd
; 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: [F: nonnull_exec_ctx_1] 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(ptr %a)
; 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] 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] %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] 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] 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] %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] %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] 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] 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] %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] br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
br i1 %tmp3, label %ex, label %hd
ex:
- %tmp5 = tail call i32 @g(i32* nonnull %a)
+ %tmp5 = tail call i32 @g(ptr nonnull %a)
ret i32 %tmp5
hd:
%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
%tmp9 = icmp eq i32 %tmp8, %b
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-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] %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: -- 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] %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] %tmp3 = icmp eq i32 %b, 0
-; MBEC-NEXT: -- Explore context of: %tmp5 = tail call i32 @g(i32* nonnull %a)
-; MBEC-NEXT: [F: nonnull_exec_ctx_2] %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(ptr nonnull %a)
; 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] %tmp3 = icmp eq i32 %b, 0
; 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] %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] %tmp3 = icmp eq i32 %b, 0
; 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] 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] %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] %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] br i1 %tmp3, label %ex, label %hd
; 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: [F: nonnull_exec_ctx_2] 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(ptr %a)
; 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] 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] %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] %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] 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] 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] br i1 %tmp3, label %ex, label %hd
; 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: [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] %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] %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] br i1 %tmp3, label %ex, label %hd
; 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: [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] %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] 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] br i1 %tmp3, label %ex, label %hd
; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
br i1 %tmp3, label %ex, label %hd
ex:
- %tmp5 = tail call i32 @g(i32* nonnull %a)
+ %tmp5 = tail call i32 @g(ptr nonnull %a)
ret i32 %tmp5
hd:
%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
%tmp9 = icmp eq i32 %tmp8, %b
br i1 %tmp9, label %ex, label %hd
@X = common global i32 0
; CHECK-LABEL: PHI Values for function: simple
-define void @simple(i32* %ptr) {
+define void @simple(ptr %ptr) {
entry:
br i1 undef, label %if, label %else
; CHECK: PHI %phi2 has values:
; CHECK-DAG: @X
; CHECK-DAG: %ptr
- %phi2 = phi i32* [ @X, %if ], [ %ptr, %else ]
+ %phi2 = phi ptr [ @X, %if ], [ %ptr, %else ]
ret void
}
; analysis doesn't repeatedly add a phis values to itself until it segfaults.
; CHECK-LABEL: PHI Values for function: fn
-define void @fn(i8* %arg) {
+define void @fn(ptr %arg) {
entry:
br label %for.body
for.body:
; CHECK: PHI %phi1 has values:
-; CHECK-DAG: i8* %arg
-; CHECK-DAG: i8* undef
- %phi1 = phi i8* [ %arg, %entry ], [ %phi2, %end ]
+; CHECK-DAG: ptr %arg
+; CHECK-DAG: ptr undef
+ %phi1 = phi ptr [ %arg, %entry ], [ %phi2, %end ]
switch i32 undef, label %end [
i32 1, label %bb1
i32 2, label %bb2
end:
; CHECK: PHI %phi2 has values:
-; CHECK-DAG: i8* %arg
-; CHECK-DAG: i8* 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 ]
+; CHECK-DAG: ptr %arg
+; CHECK-DAG: ptr undef
+ %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
}
; phi values analysis to segfault if it's not careful about that kind of thing.
; CHECK-LABEL: PHI Values for function: fn
-define void @fn(i32* %arg) {
+define void @fn(ptr %arg) {
entry:
br label %while1.cond
while1.cond:
; CHECK: PHI %phi1 has values:
-; CHECK: i32* %arg
- %phi1 = phi i32* [ %arg, %entry ], [ %phi2, %while1.then ]
+; CHECK: ptr %arg
+ %phi1 = phi ptr [ %arg, %entry ], [ %phi2, %while1.then ]
br i1 undef, label %while1.end, label %while1.body
while1.body:
while1.then:
; CHECK: PHI %phi2 has values:
-; CHECK: i32* %arg
- %phi2 = phi i32* [ %arg, %while1.if ], [ %phi1, %while1.body ]
+; CHECK: ptr %arg
+ %phi2 = phi ptr [ %arg, %while1.if ], [ %phi1, %while1.body ]
br label %while1.cond
while1.end:
while2.cond1:
; CHECK: PHI %phi3 has values:
-; CHECK: i32* %arg
- %phi3 = phi i32* [ %phi1, %while1.end ], [ %phi5, %while2.then ]
+; CHECK: ptr %arg
+ %phi3 = phi ptr [ %phi1, %while1.end ], [ %phi5, %while2.then ]
br i1 undef, label %while2.end, label %while2.body1
while2.body1:
while2.cond2:
; CHECK: PHI %phi4 has values:
-; CHECK: i32* %arg
- %phi4 = phi i32* [ %phi3, %while2.body1 ], [ %phi4, %while2.if ]
+; CHECK: ptr %arg
+ %phi4 = phi ptr [ %phi3, %while2.body1 ], [ %phi4, %while2.if ]
br i1 undef, label %while2.then, label %while2.if
while2.if:
while2.then:
; CHECK: PHI %phi5 has values:
-; CHECK: i32* %arg
- %phi5 = phi i32* [ %phi3, %while2.body1 ], [ %phi4, %while2.cond2 ]
+; CHECK: ptr %arg
+ %phi5 = phi ptr [ %phi3, %while2.body1 ], [ %phi4, %while2.cond2 ]
br label %while2.cond1
while2.end:
while3.cond1:
; CHECK: PHI %phi6 has values:
-; CHECK: i32* %arg
- %phi6 = phi i32* [ %phi3, %while2.end ], [ %phi7, %while3.cond2 ]
+; CHECK: ptr %arg
+ %phi6 = phi ptr [ %phi3, %while2.end ], [ %phi7, %while3.cond2 ]
br i1 undef, label %while3.end, label %while3.cond2
while3.cond2:
; CHECK: PHI %phi7 has values:
-; CHECK: i32* %arg
- %phi7 = phi i32* [ %phi6, %while3.cond1 ], [ %phi7, %while3.body ]
+; CHECK: ptr %arg
+ %phi7 = phi ptr [ %phi6, %while3.cond1 ], [ %phi7, %while3.body ]
br i1 undef, label %while3.cond1, label %while3.body
while3.body:
while4.cond1:
; CHECK: PHI %phi8 has values:
-; CHECK: i32* %arg
- %phi8 = phi i32* [ %phi6, %while3.end ], [ %phi10, %while4.then ]
+; CHECK: ptr %arg
+ %phi8 = phi ptr [ %phi6, %while3.end ], [ %phi10, %while4.then ]
br i1 undef, label %while4.end, label %while4.if
while4.if:
while4.cond2:
; CHECK: PHI %phi9 has values:
-; CHECK: i32* %arg
- %phi9 = phi i32* [ %phi8, %while4.if ], [ %phi9, %while4.body ]
+; CHECK: ptr %arg
+ %phi9 = phi ptr [ %phi8, %while4.if ], [ %phi9, %while4.body ]
br i1 undef, label %while4.then, label %while4.body
while4.body:
while4.then:
; CHECK: PHI %phi10 has values:
-; CHECK: i32* %arg
- %phi10 = phi i32* [ %phi8, %while4.if ], [ %phi9, %while4.cond2 ]
+; CHECK: ptr %arg
+ %phi10 = phi ptr [ %phi8, %while4.if ], [ %phi9, %while4.cond2 ]
br label %while4.cond1
while4.end:
while5.cond:
; CHECK: PHI %phi11 has values:
-; CHECK: i32* %arg
- %phi11 = phi i32* [ %phi8, %while4.end ], [ %phi13, %while5.then ]
+; CHECK: ptr %arg
+ %phi11 = phi ptr [ %phi8, %while4.end ], [ %phi13, %while5.then ]
br i1 undef, label %while5.end, label %while5.body1
while5.body1:
while5.if:
; CHECK: PHI %phi12 has values:
-; CHECK: i32* %arg
- %phi12 = phi i32* [ %phi11, %while5.body1 ], [ %phi12, %while5.body2 ]
+; CHECK: ptr %arg
+ %phi12 = phi ptr [ %phi11, %while5.body1 ], [ %phi12, %while5.body2 ]
br i1 undef, label %while5.then, label %while5.body2
while5.body2:
while5.then:
; CHECK: PHI %phi13 has values:
-; CHECK: i32* %arg
- %phi13 = phi i32* [ %phi11, %while5.body1 ], [ %phi12, %while5.if ]
+; CHECK: ptr %arg
+ %phi13 = phi ptr [ %phi11, %while5.body1 ], [ %phi12, %while5.if ]
br label %while5.cond
while5.end:
while6.cond1:
; CHECK: PHI %phi14 has values:
-; CHECK: i32* %arg
- %phi14 = phi i32* [ %phi11, %while5.end ], [ %phi14, %while6.cond1 ]
+; CHECK: ptr %arg
+ %phi14 = phi ptr [ %phi11, %while5.end ], [ %phi14, %while6.cond1 ]
br i1 undef, label %while6.cond2, label %while6.cond1
while6.cond2:
; CHECK: PHI %phi15 has values:
-; CHECK: i32* %arg
- %phi15 = phi i32* [ %phi14, %while6.cond1 ], [ %phi15, %while6.cond2 ]
+; CHECK: ptr %arg
+ %phi15 = phi ptr [ %phi14, %while6.cond1 ], [ %phi15, %while6.cond2 ]
br label %while6.cond2
}
define void @fn1() {
entry:
- store i32 5, i32* @a, align 4
+ store i32 5, ptr @a, align 4
%call = call i32 (...) @foo()
%tobool = icmp ne i32 %call, 0
br i1 %tobool, label %if.then, label %if.end
br label %loop
if.end: ; preds = %entry
- store i32 6, i32* @a, align 4
+ store i32 6, ptr @a, align 4
ret void
}
define void @fn1() {
entry:
- store i32 5, i32* @a, align 4
+ store i32 5, ptr @a, align 4
%call = call i32 (...) @foo()
%tobool = icmp ne i32 %call, 0
br i1 %tobool, label %if.then, label %if.end
br label %loop
loop: ; preds = %loop, %if.then
- %0 = load i32, i32* @a, align 4
+ %0 = load i32, ptr @a, align 4
call void @bar(i32 %0)
br label %loop
if.end: ; preds = %entry
- store i32 6, i32* @a, align 4
+ store i32 6, ptr @a, align 4
ret void
}
define void @fn1() {
entry:
- store i32 5, i32* @a, align 4
+ store i32 5, ptr @a, align 4
%call = call i32 (...) @foo()
%tobool = icmp ne i32 %call, 0
br i1 %tobool, label %if.then, label %if.end
br label %loop
loop: ; preds = %loop, %if.then
- %0 = load i32, i32* @a, align 4
+ %0 = load i32, ptr @a, align 4
call void @bar(i32 %0)
br i1 true, label %loop, label %if.then
if.end: ; preds = %entry
- store i32 6, i32* @a, align 4
+ store i32 6, ptr @a, align 4
ret void
}
%tmp = alloca i8
%dst = 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]+]]
- call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull %src), !noalias !4
- store i8 %input, i8* %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.lifetime.end.p0i8(i64 8, i8* 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
- %ret_value = load i8, i8* %dst
+; 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.p0(i64 8, ptr nonnull %src), !noalias !4
+ store i8 %input, ptr %src
+ 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.p0(i64 8, ptr nonnull %src), !noalias !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, ptr %dst
ret i8 %ret_value
}
; CHECK-DAG: ![[CALLEE0_B:[0-9]+]] = distinct !{!{{[0-9]+}}, !{{[0-9]+}}, !"callee0: %b"}
; CHECK-DAG: ![[SCOPE]] = !{![[CALLEE0_A]], ![[CALLEE0_B]]}
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i1)
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture)
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
+declare void @llvm.memcpy.p0.p0.i64(ptr, ptr, i64, i1)
!0 = !{!1, !7}
!1 = distinct !{!1, !3, !"callee0: %a"}
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"
-define void @foo1(float* nocapture %a, float* nocapture readonly %c) #0 {
+define void @foo1(ptr nocapture %a, ptr nocapture readonly %c) #0 {
entry:
; CHECK-LABEL: Function: foo1
- %0 = load float, float* %c, align 4, !alias.scope !0
- %arrayidx.i = getelementptr inbounds float, float* %a, i64 5
- store float %0, float* %arrayidx.i, align 4, !noalias !6
+ %0 = load float, ptr %c, align 4, !alias.scope !0
+ %arrayidx.i = getelementptr inbounds float, ptr %a, i64 5
+ store float %0, ptr %arrayidx.i, align 4, !noalias !6
- %1 = load float, float* %c, align 4, !alias.scope !7
- %arrayidx.i2 = getelementptr inbounds float, float* %a, i64 15
- store float %1, float* %arrayidx.i2, align 4, !noalias !6
+ %1 = load float, ptr %c, align 4, !alias.scope !7
+ %arrayidx.i2 = getelementptr inbounds float, ptr %a, i64 15
+ store float %1, ptr %arrayidx.i2, align 4, !noalias !6
- %2 = load float, float* %c, align 4, !alias.scope !6
- %arrayidx.i3 = getelementptr inbounds float, float* %a, i64 16
- store float %2, float* %arrayidx.i3, align 4, !noalias !7
+ %2 = load float, ptr %c, align 4, !alias.scope !6
+ %arrayidx.i3 = getelementptr inbounds float, ptr %a, i64 16
+ store float %2, ptr %arrayidx.i3, align 4, !noalias !7
ret void
}
; A list of scopes from both domains.
!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, float* %c, align 4, !alias.scope !0 <-> store float %1, float* %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: 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, float* %c, align 4, !alias.scope !7 <-> store float %1, float* %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: %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, float* %c, align 4, !alias.scope !6 <-> store float %1, float* %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: 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 %2, float* %arrayidx.i3, align 4, !noalias !7 <-> store float %0, float* %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: %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, ptr %c, align 4, !alias.scope !0 <-> store float %1, ptr %arrayidx.i2, align 4, !noalias !6
+; 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, ptr %c, align 4, !alias.scope !7 <-> store float %0, ptr %arrayidx.i, 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, ptr %c, align 4, !alias.scope !7 <-> store float %2, ptr %arrayidx.i3, align 4, !noalias !7
+; 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, ptr %c, align 4, !alias.scope !6 <-> store float %1, ptr %arrayidx.i2, align 4, !noalias !6
+; 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, ptr %arrayidx.i2, align 4, !noalias !6 <-> store float %0, ptr %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, ptr %arrayidx.i3, align 4, !noalias !7 <-> store float %1, ptr %arrayidx.i2, align 4, !noalias !6
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"
-define void @foo1(float* nocapture %a, float* nocapture readonly %c) #0 {
+define void @foo1(ptr nocapture %a, ptr nocapture readonly %c) #0 {
entry:
; CHECK-LABEL: Function: foo1
- %0 = load float, float* %c, align 4, !alias.scope !2
- %arrayidx.i = getelementptr inbounds float, float* %a, i64 5
- store float %0, float* %arrayidx.i, align 4, !noalias !2
- %1 = load float, float* %c, align 4
- %arrayidx = getelementptr inbounds float, float* %a, i64 7
- store float %1, float* %arrayidx, align 4
+ %0 = load float, ptr %c, align 4, !alias.scope !2
+ %arrayidx.i = getelementptr inbounds float, ptr %a, i64 5
+ store float %0, ptr %arrayidx.i, align 4, !noalias !2
+ %1 = load float, ptr %c, align 4
+ %arrayidx = getelementptr inbounds float, ptr %a, i64 7
+ store float %1, ptr %arrayidx, align 4
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: MayAlias: %0 = load float, float* %c, align 4, !alias.scope !0 <-> store float %1, float* %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, float* %c, align 4 <-> store float %1, float* %arrayidx, align 4
-; CHECK: NoAlias: store float %1, float* %arrayidx, align 4 <-> 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, ptr %c, align 4, !alias.scope !0 <-> store float %1, ptr %arrayidx, align 4
+; CHECK: MayAlias: %1 = load float, ptr %c, align 4 <-> store float %0, ptr %arrayidx.i, align 4, !noalias !0
+; CHECK: MayAlias: %1 = load float, ptr %c, align 4 <-> store float %1, ptr %arrayidx, align 4
+; CHECK: NoAlias: store float %1, ptr %arrayidx, align 4 <-> store float %0, ptr %arrayidx.i, align 4, !noalias !0
}
attributes #0 = { nounwind uwtable }
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"
-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:
; CHECK-LABEL: Function: foo2
- %0 = load float, float* %c, align 4, !alias.scope !0
- %arrayidx.i = getelementptr inbounds float, float* %a, i64 5
- store float %0, float* %arrayidx.i, align 4, !alias.scope !5, !noalias !4
- %arrayidx1.i = getelementptr inbounds float, float* %b, i64 8
- store float %0, float* %arrayidx1.i, align 4, !alias.scope !0, !noalias !5
- %1 = load float, float* %c, align 4
- %arrayidx = getelementptr inbounds float, float* %a, i64 7
- store float %1, float* %arrayidx, align 4
+ %0 = load float, ptr %c, align 4, !alias.scope !0
+ %arrayidx.i = getelementptr inbounds float, ptr %a, i64 5
+ store float %0, ptr %arrayidx.i, align 4, !alias.scope !5, !noalias !4
+ %arrayidx1.i = getelementptr inbounds float, ptr %b, i64 8
+ store float %0, ptr %arrayidx1.i, align 4, !alias.scope !0, !noalias !5
+ %1 = load float, ptr %c, align 4
+ %arrayidx = getelementptr inbounds float, ptr %a, i64 7
+ store float %1, ptr %arrayidx, align 4
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: 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: MayAlias: %0 = load float, float* %c, align 4, !alias.scope !0 <-> store float %1, float* %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, float* %c, align 4 <-> store float %0, float* %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: NoAlias: store float %0, float* %arrayidx1.i, align 4, !alias.scope !0, !noalias !4 <-> store float %0, float* %arrayidx.i, align
+; CHECK: MayAlias: %0 = load float, ptr %c, align 4, !alias.scope !0 <-> store float %1, ptr %arrayidx, align 4
+; 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, ptr %c, align 4 <-> store float %0, ptr %arrayidx1.i, align 4, !alias.scope !0, !noalias !4
+; CHECK: MayAlias: %1 = load float, ptr %c, align 4 <-> store float %1, ptr %arrayidx, align 4
+; 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: NoAlias: store float %1, float* %arrayidx, align 4 <-> store float %0, float* %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: 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, ptr %arrayidx, align 4 <-> store float %0, ptr %arrayidx1.i, align 4, !alias.scope !0, !noalias !
; CHECK: 4
}
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-unknown-linux"
-attributes #0 = { noinline sanitize_memtag "target-features"="+mte,+neon" }
-
-@InterposableAliasWrite1 = linkonce dso_local alias void(i8*), void(i8*)* @Write1
+@InterposableAliasWrite1 = linkonce dso_local alias void(ptr), ptr @Write1
-@PreemptableAliasWrite1 = dso_preemptable alias void(i8*), void(i8*)* @Write1
-@AliasToPreemptableAliasWrite1 = dso_local alias void(i8*), void(i8*)* @PreemptableAliasWrite1
+@PreemptableAliasWrite1 = dso_preemptable alias void(ptr), ptr @Write1
+@AliasToPreemptableAliasWrite1 = dso_local alias void(ptr), ptr @PreemptableAliasWrite1
-@AliasWrite1 = dso_local alias void(i8*), void(i8*)* @Write1
+@AliasWrite1 = dso_local alias void(ptr), ptr @Write1
-@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*)*)
+@BitcastAliasWrite1 = dso_local alias void(ptr), ptr @Write1
+@AliasToBitcastAliasWrite1 = dso_local alias void(ptr), ptr @BitcastAliasWrite1
-define dso_local void @Write1(i8* %p) #0 {
+define dso_local void @Write1(ptr %p) #0 {
entry:
- store i8 0, i8* %p, align 1
+ store i8 0, ptr %p, align 1
ret void
}
+
+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:
- store i8 0, i8* %p, align 1
+ store i8 0, ptr %p, align 1
ret void
}
-define dso_local void @Write4(i8* %p) #0 {
+define dso_local void @Write4(ptr %p) #0 {
entry:
- %cast = bitcast i8* %p to i32*
- store i32 0, i32* %cast, align 1
+ store i32 0, ptr %p, align 1
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:
- %cast0 = bitcast i8* %p to i32*
- store i32 0, i32* %cast0, align 1
- %cast1 = bitcast i8* %q to i32*
- store i32 0, i32* %cast1, align 1
+ store i32 0, ptr %p, align 1
+ store i32 0, ptr %q, align 1
ret void
}
-define dso_local void @Write8(i8* %p) #0 {
+define dso_local void @Write8(ptr %p) #0 {
entry:
- %cast0 = bitcast i8* %p to i64*
- store i64 0, i64* %cast0, align 1
+ store i64 0, ptr %p, align 1
ret void
}
-define dso_local i8* @WriteAndReturn8(i8* %p) #0 {
+define dso_local ptr @WriteAndReturn8(ptr %p) #0 {
entry:
- store i8 0, i8* %p, align 1
- ret i8* %p
+ store i8 0, ptr %p, align 1
+ 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:
- store i8 0, i8* %p, align 1
+ store i8 0, ptr %p, align 1
ret void
}
-define linkonce dso_local void @InterposableWrite1(i8* %p) #0 {
+define linkonce dso_local void @InterposableWrite1(ptr %p) #0 {
entry:
- store i8 0, i8* %p, align 1
+ store i8 0, ptr %p, align 1
ret void
}
-define dso_local i8* @ReturnDependent(i8* %p) #0 {
+define dso_local ptr @ReturnDependent(ptr %p) #0 {
entry:
- %p2 = getelementptr i8, i8* %p, i64 2
- ret i8* %p2
+ %p2 = getelementptr i8, ptr %p, i64 2
+ ret ptr %p2
}
; access range [2, 6)
-define dso_local void @Rec0(i8* %p) #0 {
+define dso_local void @Rec0(ptr %p) #0 {
entry:
- %p1 = getelementptr i8, i8* %p, i64 2
- call void @Write4(i8* %p1)
+ %p1 = getelementptr i8, ptr %p, i64 2
+ call void @Write4(ptr %p1)
ret void
}
; access range [3, 7)
-define dso_local void @Rec1(i8* %p) #0 {
+define dso_local void @Rec1(ptr %p) #0 {
entry:
- %p1 = getelementptr i8, i8* %p, i64 1
- call void @Rec0(i8* %p1)
+ %p1 = getelementptr i8, ptr %p, i64 1
+ call void @Rec0(ptr %p1)
ret void
}
; access range [-2, 2)
-define dso_local void @Rec2(i8* %p) #0 {
+define dso_local void @Rec2(ptr %p) #0 {
entry:
- %p1 = getelementptr i8, i8* %p, i64 -5
- call void @Rec1(i8* %p1)
+ %p1 = getelementptr i8, ptr %p, i64 -5
+ call void @Rec1(ptr %p1)
ret void
}
; 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:
%cmp = icmp eq i32 %size, 0
br i1 %cmp, label %return, label %if.end
if.end:
- %load0 = load i32, i32* %p, align 4
- %load1 = load i32, i32* %acc, align 4
+ %load0 = load i32, ptr %p, align 4
+ %load1 = load i32, ptr %acc, align 4
%add = add nsw i32 %load1, %load0
- store i32 %add, i32* %acc, align 4
- %add.ptr = getelementptr inbounds i32, i32* %p, i64 1
+ store i32 %add, ptr %acc, align 4
+ %add.ptr = getelementptr inbounds i32, ptr %p, i64 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
return:
}
; 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:
%cmp = icmp eq i32 %size, 0
br i1 %cmp, label %return, label %if.end
if.end:
- store i32 0, i32* %acc, align 4
- %acc2 = getelementptr inbounds i32, i32* %acc, i64 1
+ store i32 0, ptr %acc, align 4
+ %acc2 = getelementptr inbounds i32, ptr %acc, i64 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
return:
ret void
}
-define dso_local i64* @ReturnAlloca() {
+define dso_local ptr @ReturnAlloca() {
entry:
%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:
- call void @Private(i8* %p)
+ call void @Private(ptr %p)
ret void
}
-define dso_local void @Write1SameModule(i8* %p) #0 {
+define dso_local void @Write1SameModule(ptr %p) #0 {
entry:
- call void @Write1(i8* %p)
+ call void @Write1(ptr %p)
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:
- call void @Write1Module0(i8* %p)
+ call void @Write1Module0(ptr %p)
ret void
}
-define private dso_local void @Private(i8* %p) #0 {
+define private dso_local void @Private(ptr %p) #0 {
entry:
- %p1 = getelementptr i8, i8* %p, i64 -1
- store i8 0, i8* %p1, align 1
+ %p1 = getelementptr i8, ptr %p, i64 -1
+ store i8 0, ptr %p1, align 1
ret void
}
-define dso_local void @Write1Weak(i8* %p) #0 {
+define dso_local void @Write1Weak(ptr %p) #0 {
entry:
- call void @Weak(i8* %p)
+ call void @Weak(ptr %p)
ret void
}
-define weak dso_local void @Weak(i8* %p) #0 {
+define weak dso_local void @Weak(ptr %p) #0 {
entry:
- %p1 = getelementptr i8, i8* %p, i64 -1
- store i8 0, i8* %p1, align 1
+ %p1 = getelementptr i8, ptr %p, i64 -1
+ store i8 0, ptr %p1, align 1
ret void
}
target triple = "i386-pc-linux-gnu"
; 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:
%0 = alloca i32, align 4
%1 = alloca i8, i64 32, align 32
- %2 = ptrtoint i8* %1 to i32
- store i32 %2, i32* %0, align 4
+ %2 = ptrtoint ptr %1 to i32
+ store i32 %2, ptr %0, align 4
ret i32 0
}
; RUN: -r %t.summ1.bc,PreemptableAliasWrite1,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: 2>&1 | FileCheck %s --check-prefixes=CHECK,GLOBAL,LTO
attributes #0 = { noinline sanitize_memtag "target-features"="+mte,+neon" }
-declare void @PreemptableAliasWrite1(i8* %p)
-declare void @AliasToPreemptableAliasWrite1(i8* %p)
+declare void @PreemptableAliasWrite1(ptr %p)
+declare void @AliasToPreemptableAliasWrite1(ptr %p)
-declare void @InterposableAliasWrite1(i8* %p)
+declare void @InterposableAliasWrite1(ptr %p)
; Aliases to interposable aliases are not allowed
-declare void @AliasWrite1(i8* %p)
+declare void @AliasWrite1(ptr %p)
-declare void @BitcastAliasWrite1(i32* %p)
-declare void @AliasToBitcastAliasWrite1(i8* %p)
+declare void @BitcastAliasWrite1(ptr %p)
+declare void @AliasToBitcastAliasWrite1(ptr %p)
; Call to dso_preemptable alias to a dso_local aliasee
define void @PreemptableAliasCall() #0 {
; CHECK-EMPTY:
entry:
%x1 = alloca i8
- call void @PreemptableAliasWrite1(i8* %x1)
+ call void @PreemptableAliasWrite1(ptr %x1)
%x2 = alloca i8
; Alias to a preemptable alias is not preemptable
- call void @AliasToPreemptableAliasWrite1(i8* %x2)
+ call void @AliasToPreemptableAliasWrite1(ptr %x2)
ret void
}
entry:
%x = alloca i8
; ThinLTO can resolve the prevailing implementation for interposable definitions.
- call void @InterposableAliasWrite1(i8* %x)
+ call void @InterposableAliasWrite1(ptr %x)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i8
- call void @AliasWrite1(i8* %x)
+ call void @AliasWrite1(ptr %x)
ret void
}
; CHECK-EMPTY:
entry:
%x1 = alloca i32
- call void @BitcastAliasWrite1(i32* %x1)
+ call void @BitcastAliasWrite1(ptr %x1)
%x2 = alloca i8
- call void @AliasToBitcastAliasWrite1(i8* %x2)
+ call void @AliasToBitcastAliasWrite1(ptr %x2)
ret void
}
; CHECK-NEXT: p[]: [0,1){{$}}
; CHECK-NEXT: allocas uses:
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: store i8 0, i8* %p, align 1
+; GLOBAL-NEXT: store i8 0, ptr %p, align 1
; CHECK-EMPTY:
; RUN: -r %t.summ1.bc,Write8,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: 2>&1 | FileCheck %s --check-prefixes=CHECK,GLOBAL,LTO
attributes #0 = { noinline sanitize_memtag "target-features"="+mte,+neon" }
-declare void @Write1(i8* %p)
-declare void @Write4(i8* %p)
-declare void @Write4_2(i8* %p, i8* %q)
-declare void @Write8(i8* %p)
-declare dso_local i8* @WriteAndReturn8(i8* %p)
-declare dso_local void @ExternalCall(i8* %p)
-declare void @PreemptableWrite1(i8* %p)
-declare void @InterposableWrite1(i8* %p)
-declare i8* @ReturnDependent(i8* %p)
-declare void @Rec2(i8* %p)
-declare void @RecursiveNoOffset(i32* %p, i32 %size, i32* %acc)
-declare void @RecursiveWithOffset(i32 %size, i32* %acc)
-declare void @Write1SameModule(i8* %p)
-declare void @Write1DiffModule(i8* %p)
-declare void @Write1Private(i8* %p)
-declare void @Write1Weak(i8* %p)
+declare void @Write1(ptr %p)
+declare void @Write4(ptr %p)
+declare void @Write4_2(ptr %p, ptr %q)
+declare void @Write8(ptr %p)
+declare dso_local ptr @WriteAndReturn8(ptr %p)
+declare dso_local void @ExternalCall(ptr %p)
+declare void @PreemptableWrite1(ptr %p)
+declare void @InterposableWrite1(ptr %p)
+declare ptr @ReturnDependent(ptr %p)
+declare void @Rec2(ptr %p)
+declare void @RecursiveNoOffset(ptr %p, i32 %size, ptr %acc)
+declare void @RecursiveWithOffset(i32 %size, ptr %acc)
+declare void @Write1SameModule(ptr %p)
+declare void @Write1DiffModule(ptr %p)
+declare void @Write1Private(ptr %p)
+declare void @Write1Weak(ptr %p)
; Basic out-of-bounds.
define void @f1() #0 {
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- call void @Write8(i8* %x1)
+ call void @Write8(ptr %x)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- call void @Write1(i8* %x1)
+ call void @Write1(ptr %x)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- call void @Write4(i8* %x1)
+ call void @Write4(ptr %x)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- %x2 = getelementptr i8, i8* %x1, i64 1
- call void @Write1(i8* %x2)
+ %x2 = getelementptr i8, ptr %x, i64 1
+ call void @Write1(ptr %x2)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- %x2 = getelementptr i8, i8* %x1, i64 1
- call void @Write4(i8* %x2)
+ %x2 = getelementptr i8, ptr %x, i64 1
+ call void @Write4(ptr %x2)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- call void @ExternalCall(i8* %x1)
+ call void @ExternalCall(ptr %x)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- call void @PreemptableWrite1(i8* %x1)
+ call void @PreemptableWrite1(ptr %x)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- call void @InterposableWrite1(i8* %x1)
+ call void @InterposableWrite1(ptr %x)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- call void @PrivateWrite1(i8* %x1)
+ call void @PrivateWrite1(ptr %x)
ret void
}
-define private void @PrivateWrite1(i8* %p) #0 {
+define private void @PrivateWrite1(ptr %p) #0 {
; CHECK-LABEL: @PrivateWrite1{{$}}
; CHECK-NEXT: args uses:
; CHECK-NEXT: p[]: [0,1){{$}}
; CHECK-NEXT: allocas uses:
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: store i8 0, i8* %p, align 1
+; GLOBAL-NEXT: store i8 0, ptr %p, align 1
; CHECK-EMPTY:
entry:
- store i8 0, i8* %p, align 1
+ store i8 0, ptr %p, align 1
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- %x2 = call i8* @ReturnDependent(i8* %x1)
+ %x2 = call ptr @ReturnDependent(ptr %x)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i64, align 4
- %x1 = bitcast i64* %x to i8*
- %x2 = getelementptr i8, i8* %x1, i64 2
+ %x2 = getelementptr i8, ptr %x, i64 2
; 2 + [-2, 2) = [0, 4) => OK
- call void @Rec2(i8* %x2)
+ call void @Rec2(ptr %x2)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i64, align 4
- %x1 = bitcast i64* %x to i8*
- %x2 = getelementptr i8, i8* %x1, i64 6
+ %x2 = getelementptr i8, ptr %x, i64 6
; 6 + [-2, 2) = [4, 8) => OK
- call void @Rec2(i8* %x2)
+ call void @Rec2(ptr %x2)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i64, align 4
- %x1 = bitcast i64* %x to i8*
- %x2 = getelementptr i8, i8* %x1, i64 1
+ %x2 = getelementptr i8, ptr %x, i64 1
; 1 + [-2, 2) = [-1, 3) => NOT OK
- call void @Rec2(i8* %x2)
+ call void @Rec2(ptr %x2)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i64, align 4
- %x1 = bitcast i64* %x to i8*
- %x2 = getelementptr i8, i8* %x1, i64 7
+ %x2 = getelementptr i8, ptr %x, i64 7
; 7 + [-2, 2) = [5, 9) => NOT OK
- call void @Rec2(i8* %x2)
+ call void @Rec2(ptr %x2)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i64, align 4
- %x1 = bitcast i64* %x to i8*
- %x2 = getelementptr i8, i8* %x1, i64 4
- call void @Write4_2(i8* %x2, i8* %x1)
+ %x2 = getelementptr i8, ptr %x, i64 4
+ call void @Write4_2(ptr %x2, ptr %x)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i64, align 4
- %x1 = bitcast i64* %x to i8*
- %x2 = getelementptr i8, i8* %x1, i64 5
- call void @Write4_2(i8* %x2, i8* %x1)
+ %x2 = getelementptr i8, ptr %x, i64 5
+ call void @Write4_2(ptr %x2, ptr %x)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i64, align 4
- %x0 = bitcast i64* %x to i8*
- %x1 = getelementptr i8, i8* %x0, i64 -1
- %x2 = getelementptr i8, i8* %x0, i64 4
- call void @Write4_2(i8* %x2, i8* %x1)
+ %x1 = getelementptr i8, ptr %x, i64 -1
+ %x2 = getelementptr i8, ptr %x, i64 4
+ call void @Write4_2(ptr %x2, ptr %x1)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i64, align 4
- %x0 = bitcast i64* %x to i8*
- %x1 = getelementptr i8, i8* %x0, i64 -1
- %x2 = getelementptr i8, i8* %x0, i64 5
- call void @Write4_2(i8* %x2, i8* %x1)
+ %x1 = getelementptr i8, ptr %x, i64 -1
+ %x2 = getelementptr i8, ptr %x, i64 5
+ call void @Write4_2(ptr %x2, ptr %x1)
ret void
}
-define i32 @TestRecursiveNoOffset(i32* %p, i32 %size) #0 {
+define i32 @TestRecursiveNoOffset(ptr %p, i32 %size) #0 {
; CHECK-LABEL: @TestRecursiveNoOffset dso_preemptable{{$}}
; CHECK-NEXT: args uses:
; LOCAL-NEXT: p[]: empty-set, @RecursiveNoOffset(arg0, [0,1)){{$}}
; CHECK-NEXT: allocas uses:
; CHECK-NEXT: sum[4]: [0,4), @RecursiveNoOffset(arg2, [0,1)){{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: store i32 0, i32* %sum, align 4
-; GLOBAL-NEXT: %1 = load i32, i32* %sum, align 4
+; GLOBAL-NEXT: store i32 0, ptr %sum, align 4
+; GLOBAL-NEXT: %load = load i32, ptr %sum, align 4
; CHECK-EMPTY:
entry:
%sum = alloca i32, align 4
- %0 = bitcast i32* %sum to i8*
- store i32 0, i32* %sum, align 4
- call void @RecursiveNoOffset(i32* %p, i32 %size, i32* %sum)
- %1 = load i32, i32* %sum, align 4
- ret i32 %1
+ store i32 0, ptr %sum, align 4
+ call void @RecursiveNoOffset(ptr %p, i32 %size, ptr %sum)
+ %load = load i32, ptr %sum, align 4
+ ret i32 %load
}
define void @TestRecursiveWithOffset(i32 %size) #0 {
; CHECK-EMPTY:
entry:
%sum = alloca i32, i64 16, align 4
- call void @RecursiveWithOffset(i32 %size, i32* %sum)
+ call void @RecursiveWithOffset(i32 %size, ptr %sum)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i8, i64 16, align 4
- %0 = call i8* @WriteAndReturn8(i8* %x)
+ %0 = call ptr @WriteAndReturn8(ptr %x)
ret void
}
; CHECK-EMPTY:
entry:
%y = alloca i8, align 4
- call void @Write1SameModule(i8* %y)
+ call void @Write1SameModule(ptr %y)
ret void
}
; CHECK-EMPTY:
entry:
%z = alloca i8, align 4
- call void @Write1DiffModule(i8* %z)
+ call void @Write1DiffModule(ptr %z)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i8, align 4
- call void @Write1Private(i8* %x)
+ call void @Write1Private(ptr %x)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i8, align 4
- call void @Write1Weak(i8* %x)
+ call void @Write1Weak(ptr %x)
ret void
}
-define private dso_local void @Private(i8* %p) #0 {
+define private dso_local void @Private(ptr %p) #0 {
entry:
- %p1 = getelementptr i8, i8* %p, i64 1
- store i8 0, i8* %p1, align 1
+ %p1 = getelementptr i8, ptr %p, i64 1
+ store i8 0, ptr %p1, align 1
ret void
}
-define dso_local void @Write1Module0(i8* %p) #0 {
+define dso_local void @Write1Module0(ptr %p) #0 {
entry:
- store i8 0, i8* %p, align 1
+ store i8 0, ptr %p, align 1
ret void
}
-define dso_local void @Weak(i8* %p) #0 {
+define dso_local void @Weak(ptr %p) #0 {
entry:
- %p1 = getelementptr i8, i8* %p, i64 1
- store i8 0, i8* %p1, align 1
+ %p1 = getelementptr i8, ptr %p, i64 1
+ store i8 0, ptr %p1, align 1
ret void
}
; CHECK-NEXT: p[]: [0,1){{$}}
; CHECK-NEXT: allocas uses:
; 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-LABEL: @Write4{{$}}
; CHECK-NEXT: p[]: [0,4){{$}}
; CHECK-NEXT: allocas uses:
; 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-LABEL: @Write4_2{{$}}
; CHECK-NEXT: q[]: [0,4){{$}}
; CHECK-NEXT: allocas uses:
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: store i32 0, i32* %cast0, align 1
-; GLOBAL-NEXT: store i32 0, i32* %cast1, align 1
+; GLOBAL-NEXT: store i32 0, ptr %p, align 1
+; GLOBAL-NEXT: store i32 0, ptr %q, align 1
; CHECK-EMPTY:
; CHECK-LABEL: @Write8{{$}}
; CHECK-NEXT: p[]: [0,8){{$}}
; CHECK-NEXT: allocas uses:
; 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-LABEL: @WriteAndReturn8{{$}}
; CHECK-NEXT: p[]: full-set{{$}}
; CHECK-NEXT: allocas uses:
; 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-LABEL: @PreemptableWrite1 dso_preemptable{{$}}
; CHECK-NEXT: p[]: [0,1){{$}}
; CHECK-NEXT: allocas uses:
; 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-LABEL: @InterposableWrite1 interposable{{$}}
; CHECK-NEXT: p[]: [0,1){{$}}
; CHECK-NEXT: allocas uses:
; 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-LABEL: @ReturnDependent{{$}}
; CHECK-NEXT: acc[]: [0,4), @RecursiveNoOffset(arg2, [0,1)){{$}}
; CHECK-NEXT: allocas uses:
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: %load0 = load i32, i32* %p, align 4
-; GLOBAL-NEXT: %load1 = load i32, i32* %acc, align 4
-; GLOBAL-NEXT: store i32 %add, i32* %acc, align 4
+; GLOBAL-NEXT: %load0 = load i32, ptr %p, align 4
+; GLOBAL-NEXT: %load1 = load i32, ptr %acc, align 4
+; GLOBAL-NEXT: store i32 %add, ptr %acc, align 4
; CHECK-EMPTY:
; CHECK-LABEL: @RecursiveWithOffset{{$}}
; GLOBAL-NEXT: acc[]: full-set, @RecursiveWithOffset(arg1, [4,5)){{$}}
; CHECK-NEXT: allocas uses:
; 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-LABEL: @ReturnAlloca
; CHECK: %y = alloca i32, align 4
; CHECK-NEXT: Alive: <>
%z = alloca i32, align 4
- %x0 = bitcast i32* %x to i8*
- %y0 = bitcast i32* %y to i8*
- %z0 = bitcast i32* %z to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %z0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %z0)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %z)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %z)
; CHECK-NEXT: Alive: <z>
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x0)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %x)
; CHECK-NEXT: Alive: <x z>
- call void @capture32(i32* %x)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
+ call void @capture32(ptr %x)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
; CHECK-NEXT: Alive: <z>
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y0)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %y)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %y)
; CHECK-NEXT: Alive: <y z>
- call void @capture32(i32* %y)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %y0)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %y0)
+ call void @capture32(ptr %y)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %y)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %y)
; CHECK-NEXT: Alive: <z>
- call void @capture32(i32* %z)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %z0)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %z0)
+ call void @capture32(ptr %z)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %z)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %z)
; CHECK-NEXT: Alive: <>
ret void
; CHECK-NEXT: Alive: <y>
%x = alloca i32, align 4
%y = alloca i32, align 4
- %x0 = bitcast i32* %x to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x0)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %x)
; CHECK-NEXT: Alive: <x y>
- call void @capture32(i32* %x)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
+ call void @capture32(ptr %x)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
; CHECK-NEXT: Alive: <y>
- call void @capture32(i32* %y)
+ call void @capture32(ptr %y)
ret void
}
%x = alloca i32, align 4
%y = alloca i32, align 4
%z = alloca i64, align 4
- %x0 = bitcast i32* %x to i8*
- %y0 = bitcast i32* %y to i8*
- %z0 = bitcast i64* %z to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x0)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %x)
; CHECK-NEXT: Alive: <x>
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y0)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %y)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %y)
; CHECK-NEXT: Alive: <x y>
- call void @capture32(i32* %x)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
+ call void @capture32(ptr %x)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
; CHECK-NEXT: Alive: <y>
- call void @capture32(i32* %y)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %y0)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %y0)
+ call void @capture32(ptr %y)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %y)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %y)
; CHECK-NEXT: Alive: <>
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %z0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %z0)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %z)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %z)
; CHECK-NEXT: Alive: <z>
- call void @capture64(i64* %z)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %z0)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %z0)
+ call void @capture64(ptr %z)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %z)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %z)
; CHECK-NEXT: Alive: <>
ret void
; CHECK-NEXT: Alive: <>
%z = alloca i64, align 4
%y = alloca i32, align 4
- %x0 = bitcast i32* %x to i8*
- %y0 = bitcast i32* %y to i8*
- %z0 = bitcast i64* %z to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x0)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %x)
; CHECK-NEXT: Alive: <x>
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y0)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %y)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %y)
; CHECK-NEXT: Alive: <x y>
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %z0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %z0)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %z)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %z)
; CHECK-NEXT: Alive: <x y z>
- call void @capture32(i32* %x)
- call void @capture32(i32* %y)
- call void @capture64(i64* %z)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
+ call void @capture32(ptr %x)
+ call void @capture32(ptr %y)
+ call void @capture64(ptr %z)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
; CHECK-NEXT: Alive: <y z>
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %y0)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %y0)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %y)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %y)
; CHECK-NEXT: Alive: <z>
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %z0)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %z0)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %z)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %z)
; CHECK-NEXT: Alive: <>
ret void
%z = alloca i64, align 8
%z1 = alloca i64, align 8
%z2 = alloca i64, align 8
- %x1.cast = bitcast i64* %x1 to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x1.cast)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x1.cast)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %x1)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %x1)
; CHECK-NEXT: Alive: <x1>
- %x2.cast = bitcast i64* %x2 to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x2.cast)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x2.cast)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %x2)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %x2)
; CHECK-NEXT: Alive: <x1 x2>
- call void @capture64(i64* nonnull %x1)
- call void @capture64(i64* nonnull %x2)
+ call void @capture64(ptr nonnull %x1)
+ call void @capture64(ptr nonnull %x2)
br i1 %a, label %if.then, label %if.else4
; CHECK: br i1 %a, label %if.then, label %if.else4
; CHECK-NEXT: Alive: <x1 x2>
if.then: ; preds = %entry
; CHECK: if.then:
; CHECK-NEXT: Alive: <x1 x2>
- %y.cast = bitcast i64* %y to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y.cast)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y.cast)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %y)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %y)
; CHECK-NEXT: Alive: <x1 x2 y>
- call void @capture64(i64* nonnull %y)
+ call void @capture64(ptr nonnull %y)
br i1 %b, label %if.then3, label %if.else
if.then3: ; preds = %if.then
; CHECK: if.then3:
; CHECK-NEXT: Alive: <x1 x2 y>
- %y1.cast = bitcast i64* %y1 to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y1.cast)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y1.cast)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %y1)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %y1)
; CHECK-NEXT: Alive: <x1 x2 y y1>
- call void @capture64(i64* nonnull %y1)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %y1.cast)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %y1.cast)
+ call void @capture64(ptr nonnull %y1)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %y1)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %y1)
; CHECK-NEXT: Alive: <x1 x2 y>
br label %if.end
if.else: ; preds = %if.then
; CHECK: if.else:
; CHECK-NEXT: Alive: <x1 x2 y>
- %y2.cast = bitcast i64* %y2 to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y2.cast)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y2.cast)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %y2)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %y2)
; CHECK-NEXT: Alive: <x1 x2 y y2>
- call void @capture64(i64* nonnull %y2)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %y2.cast)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %y2.cast)
+ call void @capture64(ptr nonnull %y2)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %y2)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %y2)
; CHECK-NEXT: Alive: <x1 x2 y>
br label %if.end
if.end: ; preds = %if.else, %if.then3
; CHECK: if.end:
; CHECK-NEXT: Alive: <x1 x2 y>
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %y.cast)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %y.cast)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %y)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %y)
; CHECK-NEXT: Alive: <x1 x2>
br label %if.end9
if.else4: ; preds = %entry
; CHECK: if.else4:
; CHECK-NEXT: Alive: <x1 x2>
-
- %z.cast = bitcast i64* %z to i8*
-; CHECK: %z.cast = bitcast i64* %z to i8*
+ %z.cast = bitcast ptr %z to ptr
+; CHECK: %z.cast = bitcast ptr %z to ptr
; CHECK-NEXT: Alive: <x1 x2>
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %z.cast)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %z.cast)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %z)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %z)
; CHECK-NEXT: Alive: <x1 x2 z>
- call void @capture64(i64* nonnull %z)
+ call void @capture64(ptr nonnull %z)
br i1 %b, label %if.then6, label %if.else7
if.then6: ; preds = %if.else4
; CHECK: if.then6:
; CHECK-NEXT: Alive: <x1 x2 z>
- %z1.cast = bitcast i64* %z1 to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %z1.cast)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %z1.cast)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %z1)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %z1)
; CHECK-NEXT: Alive: <x1 x2 z z1>
- call void @capture64(i64* nonnull %z1)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %z1.cast)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %z1.cast)
+ call void @capture64(ptr nonnull %z1)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %z1)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %z1)
; CHECK-NEXT: Alive: <x1 x2 z>
br label %if.end8
if.else7: ; preds = %if.else4
; CHECK: if.else7:
; CHECK-NEXT: Alive: <x1 x2 z>
- %z2.cast = bitcast i64* %z2 to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %z2.cast)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %z2.cast)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %z2)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %z2)
; CHECK-NEXT: Alive: <x1 x2 z z2>
- call void @capture64(i64* nonnull %z2)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %z2.cast)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %z2.cast)
+ call void @capture64(ptr nonnull %z2)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %z2)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %z2)
; CHECK-NEXT: Alive: <x1 x2 z>
br label %if.end8
if.end8: ; preds = %if.else7, %if.then6
; CHECK: if.end8:
; CHECK-NEXT: Alive: <x1 x2 z>
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %z.cast)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %z.cast)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %z)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %z)
; CHECK-NEXT: Alive: <x1 x2>
br label %if.end9
if.end9: ; preds = %if.end8, %if.end
; CHECK: if.end9:
; CHECK-NEXT: Alive: <x1 x2>
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x2.cast)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x2.cast)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %x2)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %x2)
; CHECK-NEXT: Alive: <x1>
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x1.cast)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x1.cast)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %x1)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %x1)
; CHECK-NEXT: Alive: <>
ret void
; CHECK-NEXT: Alive: <>
%x = alloca i32, align 4
%y = alloca i32, align 4
- %x0 = bitcast i32* %x to i8*
- %y0 = bitcast i32* %y to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x0)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %x)
; CHECK-NEXT: Alive: <x>
- call void @capture32(i32* %x)
+ call void @capture32(ptr %x)
br i1 %d, label %bb2, label %bb3
bb2: ; preds = %entry
; CHECK: bb2:
; CHECK-NEXT: Alive: <x>
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y0)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %y)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %y)
; CHECK-NEXT: Alive: <x y>
- call void @capture32(i32* %y)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %y0)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %y0)
+ call void @capture32(ptr %y)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %y)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %y)
; CHECK-NEXT: Alive: <x>
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
; CHECK-NEXT: Alive: <>
ret void
bb3: ; preds = %entry
; CHECK: bb3:
; CHECK-NEXT: Alive: <x>
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
; CHECK-NEXT: Alive: <>
ret void
; CHECK-NEXT: Alive: <>
%x = alloca i32, align 4
%y = alloca i32, align 4
- %x0 = bitcast i32* %x to i8*
- %y0 = bitcast i32* %y to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x0)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %x)
; CHECK-NEXT: Alive: <x>
- call void @capture32(i32* %x)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
+ call void @capture32(ptr %x)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
; CHECK-NEXT: Alive: <>
br i1 %d, label %bb2, label %bb3
bb2: ; preds = %entry
; CHECK: bb2:
; CHECK-NEXT: Alive: <>
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y0)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %y)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %y)
; CHECK-NEXT: Alive: <y>
- call void @capture32(i32* %y)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %y0)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %y0)
+ call void @capture32(ptr %y)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %y)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %y)
; CHECK-NEXT: Alive: <>
ret void
; CHECK-NEXT: Alive: <>
%x = alloca i32, align 4
%y = alloca i32, align 4
- %x0 = bitcast i32* %x to i8*
- %y0 = bitcast i32* %y to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x0)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %x)
; CHECK-NEXT: Alive: <x>
- call void @capture32(i32* %x)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
+ call void @capture32(ptr %x)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
; CHECK-NEXT: Alive: <>
br i1 %d, label %bb2, label %bb3
bb2: ; preds = %entry
; CHECK: bb2:
; CHECK-NEXT: Alive: <>
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y0)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %y)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %y)
; CHECK-NEXT: Alive: <y>
- call void @capture32(i32* %y)
+ call void @capture32(ptr %y)
ret void
bb3: ; preds = %entry
; CHECK-NEXT: Alive: <>
%x = alloca i32, align 4
%y = alloca i32, align 4
- %x0 = bitcast i32* %x to i8*
- %y0 = bitcast i32* %y to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %x0)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %x)
; CHECK-NEXT: Alive: <x>
- call void @capture32(i32* %x)
+ call void @capture32(ptr %x)
br i1 %d, label %bb2, label %bb3
bb2: ; preds = %entry
; CHECK: bb2:
; CHECK-NEXT: Alive: <x>
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
; CHECK-NEXT: Alive: <>
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y0)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %y)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %y)
; CHECK-NEXT: Alive: <y>
- call void @capture32(i32* %y)
+ call void @capture32(ptr %y)
ret void
bb3: ; preds = %entry
; CHECK-NEXT: Alive: <x>
%x = alloca i32, align 4
%y = alloca i32, align 4
- %x0 = bitcast i32* %x to i8*
- %y0 = bitcast i32* %y to i8*
- call void @capture32(i32* %x)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %x0)
+ call void @capture32(ptr %x)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %x)
; CHECK-NEXT: Alive: <x>
br i1 %d, label %bb2, label %bb3
bb2: ; preds = %entry
; CHECK: bb2:
; CHECK-NEXT: Alive: <x>
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %y0)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %y)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %y)
; CHECK-NEXT: Alive: <x y>
- call void @capture32(i32* %y)
+ call void @capture32(ptr %y)
ret void
bb3: ; preds = %entry
%B.i2 = alloca [100 x i32], align 4
%A.i = alloca [100 x i32], align 4
%B.i = alloca [100 x i32], align 4
- %A.i.cast = bitcast [100 x i32]* %A.i to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %A.i.cast)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %A.i.cast)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %A.i)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %A.i)
; CHECK-NEXT: Alive: <A.i>
- %B.i.cast = bitcast [100 x i32]* %B.i to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %B.i.cast)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %B.i.cast)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %B.i)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %B.i)
; CHECK-NEXT: Alive: <A.i B.i>
- call void @capture100x32([100 x i32]* %A.i)
-; CHECK: call void @capture100x32([100 x i32]* %A.i)
+ call void @capture100x32(ptr %A.i)
+; CHECK: call void @capture100x32(ptr %A.i)
; CHECK-NEXT: Alive: <A.i B.i>
- call void @capture100x32([100 x i32]* %B.i)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %A.i.cast)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %A.i.cast)
+ call void @capture100x32(ptr %B.i)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %A.i)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %A.i)
; CHECK-NEXT: Alive: <B.i>
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %B.i.cast)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %B.i.cast)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %B.i)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %B.i)
; CHECK-NEXT: Alive: <>
- %A.i1.cast = bitcast [100 x i32]* %A.i1 to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %A.i1.cast)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %A.i1.cast)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %A.i1)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %A.i1)
; CHECK-NEXT: Alive: <A.i1>
- %B.i2.cast = bitcast [100 x i32]* %B.i2 to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %B.i2.cast)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %B.i2.cast)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %B.i2)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %B.i2)
; CHECK-NEXT: Alive: <A.i1 B.i2>
- call void @capture100x32([100 x i32]* %A.i1)
- call void @capture100x32([100 x i32]* %B.i2)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %A.i1.cast)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %A.i1.cast)
+ call void @capture100x32(ptr %A.i1)
+ call void @capture100x32(ptr %B.i2)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %A.i1)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %A.i1)
; CHECK-NEXT: Alive: <B.i2>
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %B.i2.cast)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %B.i2.cast)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %B.i2)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %B.i2)
; CHECK-NEXT: Alive: <>
ret void
; CHECK-NEXT: Alive: <>
%buf1 = alloca i8, i32 100000, align 16
%buf2 = alloca i8, i32 100000, align 16
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %buf1)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %buf1)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %buf1)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %buf1)
; CHECK-NEXT: Alive: <buf1>
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %buf1)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %buf1)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %buf1)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %buf1)
; CHECK-NEXT: Alive: <>
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %buf1)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %buf1)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %buf1)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %buf1)
; CHECK-NEXT: Alive: <buf1>
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %buf2)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %buf2)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %buf2)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %buf2)
; CHECK-NEXT: Alive: <buf1 buf2>
- call void @capture8(i8* %buf1)
- call void @capture8(i8* %buf2)
+ call void @capture8(ptr %buf1)
+ call void @capture8(ptr %buf2)
ret void
}
%B.i2 = alloca [100 x i32], align 4
%A.i = alloca [100 x i32], align 4
%B.i = alloca [100 x i32], align 4
- %A.i.cast = bitcast [100 x i32]* %A.i to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %A.i.cast)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %A.i.cast)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %A.i)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %A.i)
; CHECK-NEXT: Alive: <A.i A.i1 B.i2>
- %B.i.cast = bitcast [100 x i32]* %B.i to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %B.i.cast)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %B.i.cast)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %B.i)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %B.i)
; CHECK-NEXT: Alive: <A.i A.i1 B.i B.i2>
- call void @capture100x32([100 x i32]* %A.i)
- call void @capture100x32([100 x i32]* %B.i)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %A.i.cast)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %A.i.cast)
+ call void @capture100x32(ptr %A.i)
+ call void @capture100x32(ptr %B.i)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %A.i)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %A.i)
; CHECK-NEXT: Alive: <A.i1 B.i B.i2>
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %B.i.cast)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %B.i.cast)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %B.i)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %B.i)
; CHECK-NEXT: Alive: <A.i1 B.i2>
br label %block2
block2: ; preds = %entry
; CHECK: block2:
; CHECK-NEXT: Alive: <A.i1 B.i2>
- call void @capture100x32([100 x i32]* %A.i)
- call void @capture100x32([100 x i32]* %B.i)
+ call void @capture100x32(ptr %A.i)
+ call void @capture100x32(ptr %B.i)
ret void
}
%struct.Klass = type { i32, i32 }
-define i32 @shady_range(i32 %argc, i8** nocapture %argv) {
-; CHECK-LABEL: define i32 @shady_range(i32 %argc, i8** nocapture %argv)
+define i32 @shady_range(i32 %argc, ptr nocapture %argv) {
+; CHECK-LABEL: define i32 @shady_range(i32 %argc, ptr nocapture %argv)
entry:
; CHECK: entry:
; CHECK-NEXT: Alive: <>
%a.i = alloca [4 x %struct.Klass], align 16
%b.i = alloca [4 x %struct.Klass], align 16
- %a8 = bitcast [4 x %struct.Klass]* %a.i to i8*
- %b8 = bitcast [4 x %struct.Klass]* %b.i to i8*
- %z2 = getelementptr inbounds [4 x %struct.Klass], [4 x %struct.Klass]* %a.i, i64 0, i64 0, i32 0
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %a8)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %a8)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %a.i)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %a.i)
; CHECK-NEXT: Alive: <a.i>
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* %b8)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %b8)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %b.i)
+; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %b.i)
; CHECK-NEXT: Alive: <a.i b.i>
- call void @capture8(i8* %a8)
- call void @capture8(i8* %b8)
- %z3 = load i32, i32* %z2, align 16
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %a8)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %a8)
+ call void @capture8(ptr %a.i)
+ call void @capture8(ptr %b.i)
+ %z3 = load i32, ptr %a.i, align 16
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %a.i)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %a.i)
; CHECK-NEXT: Alive: <b.i>
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* %b8)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* %b8)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %b.i)
+; CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr %b.i)
; CHECK-NEXT: Alive: <>
ret i32 %z3
; CHECK: entry:
; CHECK-NEXT: Alive: <>
%x = alloca i8, align 4
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %x)
; CHECK-NEXT: Alive: <x>
br label %l2
; CHECK: l2:
; MAY-NEXT: Alive: <x>
; MUST-NEXT: Alive: <>
- call void @capture8(i8* %x)
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %x)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 1, i8* %x)
+ call void @capture8(ptr %x)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %x)
+; CHECK: call void @llvm.lifetime.end.p0(i64 1, ptr %x)
; CHECK-NEXT: Alive: <>
br label %l2
; CHECK-NEXT: Alive: <>
%x = alloca i8, align 4
%y = alloca i8, align 4
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %x)
; CHECK-NEXT: Alive: <x>
br label %l2
l2: ; preds = %l2, %entry
; CHECK: l2:
; CHECK-NEXT: Alive: <x>
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %y)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %y)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %y)
+; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %y)
; CHECK-NEXT: Alive: <x y>
- call void @capture8(i8* %y)
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %y)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 1, i8* %y)
+ call void @capture8(ptr %y)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %y)
+; CHECK: call void @llvm.lifetime.end.p0(i64 1, ptr %y)
; CHECK-NEXT: Alive: <x>
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %x)
; CHECK-NEXT: Alive: <x>
- call void @capture8(i8* %x)
+ call void @capture8(ptr %x)
br label %l2
}
if.then: ; preds = %entry
; CHECK: if.then:
; CHECK-NEXT: Alive: <>
- %gep0 = getelementptr inbounds %struct.char_array, %struct.char_array* %a, i64 0, i32 0, i64 0
- call void @llvm.lifetime.start.p0i8(i64 500, i8* nonnull %gep0)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 500, i8* nonnull %gep0)
+ call void @llvm.lifetime.start.p0(i64 500, ptr nonnull %a)
+; CHECK: call void @llvm.lifetime.start.p0(i64 500, ptr nonnull %a)
; CHECK-NEXT: Alive: <a>
- tail call void @capture8(i8* %gep0)
- call void @llvm.lifetime.end.p0i8(i64 500, i8* nonnull %gep0)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 500, i8* nonnull %gep0)
+ tail call void @capture8(ptr %a)
+ call void @llvm.lifetime.end.p0(i64 500, ptr nonnull %a)
+; CHECK: call void @llvm.lifetime.end.p0(i64 500, ptr nonnull %a)
; CHECK-NEXT: Alive: <>
br label %if.end
if.else: ; preds = %entry
; CHECK: if.else:
; CHECK-NEXT: Alive: <>
- %gep1 = getelementptr inbounds %struct.char_array, %struct.char_array* %b, i64 0, i32 0, i64 0
- call void @llvm.lifetime.start.p0i8(i64 500, i8* nonnull %gep1)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 500, i8* nonnull %gep1)
+ call void @llvm.lifetime.start.p0(i64 500, ptr nonnull %b)
+; CHECK: call void @llvm.lifetime.start.p0(i64 500, ptr nonnull %b)
; CHECK-NEXT: Alive: <b>
- tail call void @capture8(i8* %gep1)
- call void @llvm.lifetime.end.p0i8(i64 500, i8* nonnull %gep1)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 500, i8* nonnull %gep1)
+ tail call void @capture8(ptr %b)
+ call void @llvm.lifetime.end.p0(i64 500, ptr nonnull %b)
+; CHECK: call void @llvm.lifetime.end.p0(i64 500, ptr nonnull %b)
; CHECK-NEXT: Alive: <>
br label %if.end
if.then:
; CHECK: if.then:
; CHECK-NEXT: Alive: <>
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %y)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %y)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %y)
+; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %y)
; CHECK-NEXT: Alive: <y>
br label %if.end
if.else:
; CHECK: if.else:
; CHECK-NEXT: Alive: <>
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %y)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %y)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %y)
+; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %y)
; CHECK-NEXT: Alive: <y>
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %x)
; CHECK-NEXT: Alive: <x y>
br label %if.end
%x = alloca i8, align 4
%y = alloca i8, align 4
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %y)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %y)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %y)
+; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %y)
; CHECK-NEXT: Alive: <y>
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %x)
; CHECK-NEXT: Alive: <x y>
br label %end
dead:
; CHECK: dead:
; CHECK-NOT: Alive:
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %y)
+ call void @llvm.lifetime.start.p0(i64 4, ptr %y)
br label %end
; CHECK: br label %end
ret void
}
-define void @non_alloca(i8* %p) {
+define void @non_alloca(ptr %p) {
; CHECK-LABEL: define void @non_alloca
entry:
; CHECK: entry:
%x = alloca i8, align 4
%y = alloca i8, align 4
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %p)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 4, i8* %p)
+ call void @llvm.lifetime.start.p0(i64 4, ptr %p)
+; CHECK: call void @llvm.lifetime.start.p0(i64 4, ptr %p)
; MAY-NEXT: Alive: <x y>
; MUST-NEXT: Alive: <>
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %x)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 4, i8* %x)
+ call void @llvm.lifetime.start.p0(i64 4, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 4, ptr %x)
; MAY-NEXT: Alive: <x y>
; MUST-NEXT: Alive: <>
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %p)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 4, i8* %p)
+ call void @llvm.lifetime.end.p0(i64 4, ptr %p)
+; CHECK: call void @llvm.lifetime.end.p0(i64 4, ptr %p)
; MAY-NEXT: Alive: <x y>
; MUST-NEXT: Alive: <>
; MUST-NEXT: Alive: <>
%x = alloca i8, align 4
%y = alloca i8, align 4
- %cxcy = select i1 %v, i8* %x, i8* %y
+ %cxcy = select i1 %v, ptr %x, ptr %y
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %cxcy)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %cxcy)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %cxcy)
+; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %cxcy)
; MAY-NEXT: Alive: <x y>
; MUST-NEXT: Alive: <>
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %x)
; MAY-NEXT: Alive: <x y>
; MUST-NEXT: Alive: <>
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %x)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 1, i8* %x)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %x)
+; CHECK: call void @llvm.lifetime.end.p0(i64 1, ptr %x)
; MAY-NEXT: Alive: <x y>
; MUST-NEXT: Alive: <>
; MAY-NEXT: Alive: <x>
; MUST-NEXT: Alive: <>
%x = alloca [5 x i32], align 4
- %x2 = getelementptr [5 x i32], [5 x i32]* %x, i64 0, i64 1
+ %x2 = getelementptr [5 x i32], ptr %x, i64 0, i64 1
- call void @llvm.lifetime.start.p0i32(i64 20, i32* %x2)
-; CHECK: call void @llvm.lifetime.start.p0i32(i64 20, i32* %x2)
+ call void @llvm.lifetime.start.p0(i64 20, ptr %x2)
+; CHECK: call void @llvm.lifetime.start.p0(i64 20, ptr %x2)
; MAY-NEXT: Alive: <x>
; MUST-NEXT: Alive: <>
- call void @llvm.lifetime.end.p0i32(i64 20, i32* %x2)
-; CHECK: call void @llvm.lifetime.end.p0i32(i64 20, i32* %x2)
+ call void @llvm.lifetime.end.p0(i64 20, ptr %x2)
+; CHECK: call void @llvm.lifetime.end.p0(i64 20, ptr %x2)
; MAY-NEXT: Alive: <x>
; MUST-NEXT: Alive: <>
; MAY-NEXT: Alive: <x>
; MUST-NEXT: Alive: <>
%x = alloca [5 x i32], align 4
- %x2 = getelementptr [5 x i32], [5 x i32]* %x, i64 0, i64 0
- call void @llvm.lifetime.start.p0i32(i64 15, i32* %x2)
-; CHECK: call void @llvm.lifetime.start.p0i32(i64 15, i32* %x2)
+ call void @llvm.lifetime.start.p0(i64 15, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 15, ptr %x)
; MAY-NEXT: Alive: <x>
; MUST-NEXT: Alive: <>
- call void @llvm.lifetime.end.p0i32(i64 15, i32* %x2)
-; CHECK: call void @llvm.lifetime.end.p0i32(i64 15, i32* %x2)
+ call void @llvm.lifetime.end.p0(i64 15, ptr %x)
+; CHECK: call void @llvm.lifetime.end.p0(i64 15, ptr %x)
; MAY-NEXT: Alive: <x>
; MUST-NEXT: Alive: <>
; CHECK: entry:
; CHECK-NEXT: Alive: <>
%x = alloca i8
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %x)
; CHECK-NEXT: Alive: <x>
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %x)
; CHECK-NEXT: Alive: <x>
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %x)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 1, i8* %x)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %x)
+; CHECK: call void @llvm.lifetime.end.p0(i64 1, ptr %x)
; CHECK-NEXT: Alive: <>
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %x)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 1, i8* %x)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %x)
+; CHECK: call void @llvm.lifetime.end.p0(i64 1, ptr %x)
; CHECK-NEXT: Alive: <>
ret void
; CHECK: if.then:
; MAY-NEXT: Alive: <x y>
; MUST-NEXT: Alive: <>
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %y)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 1, i8* %y)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %y)
+; CHECK: call void @llvm.lifetime.end.p0(i64 1, ptr %y)
; MAY-NEXT: Alive: <x>
; MUST-NEXT: Alive: <>
if.else:
; CHECK: if.else:
; CHECK-NEXT: Alive: <>
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %y)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %y)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %y)
+; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %y)
; CHECK-NEXT: Alive: <y>
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %x)
; CHECK-NEXT: Alive: <x y>
br label %if.then
%x = alloca i8, align 4
%y = alloca i8, align 4
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %x)
; CHECK-NEXT: Alive: <x>
br i1 %a, label %if.then, label %if.else
; CHECK: if.then:
; MAY-NEXT: Alive: <x>
; MUST-NEXT: Alive: <>
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %y)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %y)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %y)
+; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %y)
; MAY-NEXT: Alive: <x y>
; MUST-NEXT: Alive: <y>
if.else:
; CHECK: if.else:
; CHECK-NEXT: Alive: <x>
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %y)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 1, i8* %y)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %y)
+; CHECK: call void @llvm.lifetime.end.p0(i64 1, ptr %y)
; CHECK-NEXT: Alive: <x>
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %x)
-; CHECK: call void @llvm.lifetime.end.p0i8(i64 1, i8* %x)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %x)
+; CHECK: call void @llvm.lifetime.end.p0(i64 1, ptr %x)
; CHECK-NEXT: Alive: <>
br label %if.then
%x = alloca i8, align 4
%y = alloca i8, align 4
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %x)
+; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %x)
; CHECK-NEXT: Alive: <x>
br i1 %a, label %if.then, label %if.end
; CHECK: if.then:
; MAY-NEXT: Alive: <x y>
; MUST-NEXT: Alive: <x>
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %y)
-; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %y)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %y)
+; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %y)
; CHECK-NEXT: Alive: <x y>
br i1 %a, label %if.then, label %if.end
ret void
}
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)
-declare void @llvm.lifetime.start.p0i32(i64, i32* nocapture)
-declare void @llvm.lifetime.end.p0i32(i64, i32* nocapture)
-declare void @capture8(i8*)
-declare void @capture32(i32*)
-declare void @capture64(i64*)
-declare void @capture100x32([100 x i32]*)
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture)
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
+declare void @capture8(ptr)
+declare void @capture32(ptr)
+declare void @capture64(ptr)
+declare void @capture100x32(ptr)
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-@sink = global i8* null, align 8
+@sink = global ptr null, align 8
-declare void @llvm.memset.p0i8.i32(i8* %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.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i1 %isvolatile)
-declare void @llvm.memset.p0i8.i64(i8* %dest, i8 %val, i64 %len, i1 %isvolatile)
+declare void @llvm.memset.p0.i32(ptr %dest, i8 %val, i32 %len, i1 %isvolatile)
+declare void @llvm.memcpy.p0.p0.i32(ptr %dest, ptr %src, i32 %len, i1 %isvolatile)
+declare void @llvm.memmove.p0.p0.i32(ptr %dest, ptr %src, i32 %len, i1 %isvolatile)
+declare void @llvm.memset.p0.i64(ptr %dest, i8 %val, i64 %len, i1 %isvolatile)
-declare void @unknown_call(i8* %dest)
-declare i8* @retptr(i8* returned)
+declare void @unknown_call(ptr %dest)
+declare ptr @retptr(ptr returned)
; Address leaked.
define void @LeakAddress() {
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- store i8* %x1, i8** @sink, align 8
+ store ptr %x, ptr @sink, align 8
ret void
}
; CHECK-NEXT: allocas uses:
; CHECK-NEXT: x[4]: [0,1){{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: store i8 0, i8* %x1, align 1
+; GLOBAL-NEXT: store i8 0, ptr %x, align 1
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- store i8 0, i8* %x1, align 1
+ store i8 0, ptr %x, align 1
ret void
}
; CHECK-NEXT: allocas uses:
; CHECK-NEXT: x[4]: full-set{{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: store i8 0, i8* %x2, align 1
+; GLOBAL-NEXT: store i8 0, ptr %x2, align 1
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
%c1 = icmp sge i64 %i, 0
%c2 = icmp slt i64 %i, 4
br i1 %c1, label %c1.true, label %false
br i1 %c2, label %c2.true, label %false
c2.true:
- %x2 = getelementptr i8, i8* %x1, i64 %i
- store i8 0, i8* %x2, align 1
+ %x2 = getelementptr i8, ptr %x, i64 %i
+ store i8 0, ptr %x2, align 1
br label %false
false:
; CHECK-NEXT: allocas uses:
; CHECK-NEXT: x[4]: [0,4){{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: store i8 0, i8* %x2, align 1
+; GLOBAL-NEXT: store i8 0, ptr %x2, align 1
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
%c1 = icmp sge i64 %i, 0
%i1 = select i1 %c1, i64 %i, i64 0
%c2 = icmp slt i64 %i1, 3
%i2 = select i1 %c2, i64 %i1, i64 3
- %x2 = getelementptr i8, i8* %x1, i64 %i2
- store i8 0, i8* %x2, align 1
+ %x2 = getelementptr i8, ptr %x, i64 %i2
+ store i8 0, ptr %x2, align 1
ret void
}
; CHECK-NEXT: allocas uses:
; CHECK-NEXT: x[4]: [0,4){{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: store i32 0, i32* %x, align 4
+; GLOBAL-NEXT: store i32 0, ptr %x, align 4
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- store i32 0, i32* %x, align 4
+ store i32 0, ptr %x, align 4
ret void
}
; CHECK-NEXT: allocas uses:
; CHECK-NEXT: x[4]: [2,3){{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: store i8 0, i8* %x2, align 1
+; GLOBAL-NEXT: store i8 0, ptr %x2, align 1
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- %x2 = getelementptr i8, i8* %x1, i64 2
- store i8 0, i8* %x2, align 1
+ %x2 = getelementptr i8, ptr %x, i64 2
+ store i8 0, ptr %x2, align 1
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = ptrtoint i32* %x to i64
+ %x1 = ptrtoint ptr %x to i64
%x2 = add i64 %x1, 2
- %x3 = inttoptr i64 %x2 to i8*
- store i8 0, i8* %x3, align 1
+ %x3 = inttoptr i64 %x2 to ptr
+ store i8 0, ptr %x3, align 1
ret void
}
; GLOBAL-NEXT: x[4]: full-set, @retptr(arg0, [0,1)){{$}}
; LOCAL-NEXT: x[4]: [0,1), @retptr(arg0, [0,1)){{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: store i8 0, i8* %x2, align 1
+; GLOBAL-NEXT: store i8 0, ptr %x2, align 1
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- %x2 = call i8* @retptr(i8* %x1)
- store i8 0, i8* %x2, align 1
+ %x2 = call ptr @retptr(ptr %x)
+ store i8 0, ptr %x2, align 1
ret void
}
-define dso_local void @WriteMinMax(i8* %p) {
+define dso_local void @WriteMinMax(ptr %p) {
; CHECK-LABEL: @WriteMinMax{{$}}
; CHECK-NEXT: args uses:
; CHECK-NEXT: p[]: full-set
; CHECK-NEXT: allocas uses:
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: store i8 0, i8* %p1, align 1
-; GLOBAL-NEXT: store i8 0, i8* %p2, align 1
+; GLOBAL-NEXT: store i8 0, ptr %p1, align 1
+; GLOBAL-NEXT: store i8 0, ptr %p2, align 1
; CHECK-EMPTY:
entry:
- %p1 = getelementptr i8, i8* %p, i64 9223372036854775805
- store i8 0, i8* %p1, align 1
- %p2 = getelementptr i8, i8* %p, i64 -9223372036854775805
- store i8 0, i8* %p2, align 1
+ %p1 = getelementptr i8, ptr %p, i64 9223372036854775805
+ store i8 0, ptr %p1, align 1
+ %p2 = getelementptr i8, ptr %p, i64 -9223372036854775805
+ store i8 0, ptr %p2, align 1
ret void
}
-define dso_local void @WriteMax(i8* %p) {
+define dso_local void @WriteMax(ptr %p) {
; CHECK-LABEL: @WriteMax{{$}}
; CHECK-NEXT: args uses:
; CHECK-NEXT: p[]: [-9223372036854775807,9223372036854775806)
; CHECK-NEXT: allocas uses:
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: call void @llvm.memset.p0i8.i64(i8* %p, i8 1, i64 9223372036854775806, i1 false)
-; GLOBAL-NEXT: call void @llvm.memset.p0i8.i64(i8* %p2, i8 1, i64 9223372036854775806, i1 false)
+; GLOBAL-NEXT: call void @llvm.memset.p0.i64(ptr %p, i8 1, i64 9223372036854775806, i1 false)
+; GLOBAL-NEXT: call void @llvm.memset.p0.i64(ptr %p2, i8 1, i64 9223372036854775806, i1 false)
; CHECK-EMPTY:
entry:
- call void @llvm.memset.p0i8.i64(i8* %p, i8 1, i64 9223372036854775806, i1 0)
- %p2 = getelementptr i8, i8* %p, i64 -9223372036854775807
- call void @llvm.memset.p0i8.i64(i8* %p2, i8 1, i64 9223372036854775806, i1 0)
+ call void @llvm.memset.p0.i64(ptr %p, i8 1, i64 9223372036854775806, i1 0)
+ %p2 = getelementptr i8, ptr %p, i64 -9223372036854775807
+ call void @llvm.memset.p0.i64(ptr %p2, i8 1, i64 9223372036854775806, i1 0)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- %x2 = getelementptr i8, i8* %x1, i64 2
- %x3 = bitcast i8* %x2 to i32*
- store i32 0, i32* %x3, align 1
+ %x2 = getelementptr i8, ptr %x, i64 2
+ store i32 0, ptr %x2, align 1
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
%c1 = icmp sge i64 %i, 0
%c2 = icmp slt i64 %i, 5
br i1 %c1, label %c1.true, label %false
br i1 %c2, label %c2.true, label %false
c2.true:
- %x2 = getelementptr i8, i8* %x1, i64 %i
- store i8 0, i8* %x2, align 1
+ %x2 = getelementptr i8, ptr %x, i64 %i
+ store i8 0, ptr %x2, align 1
br label %false
false:
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
%c2 = icmp slt i64 %i, 5
br i1 %c2, label %c2.true, label %false
c2.true:
- %x2 = getelementptr i8, i8* %x1, i64 %i
- store i8 0, i8* %x2, align 1
+ %x2 = getelementptr i8, ptr %x, i64 %i
+ store i8 0, ptr %x2, align 1
br label %false
false:
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- %x2 = getelementptr i8, i8* %x1, i64 2
- %x3 = call i8* @retptr(i8* %x2)
- %x4 = bitcast i8* %x3 to i32*
- store i32 0, i32* %x4, align 1
+ %x2 = getelementptr i8, ptr %x, i64 2
+ %x3 = call ptr @retptr(ptr %x2)
+ store i32 0, ptr %x3, align 1
ret void
}
; CHECK-NEXT: allocas uses:
; CHECK-NEXT: x[4]: [0,1){{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: %v = load i8, i8* %x1, align 1
+; GLOBAL-NEXT: %v = load i8, ptr %x, align 1
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- %v = load i8, i8* %x1, align 1
+ %v = load i8, ptr %x, align 1
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- %x2 = getelementptr i8, i8* %x1, i64 2
- %x3 = bitcast i8* %x2 to i32*
- %v = load i32, i32* %x3, align 1
+ %x2 = getelementptr i8, ptr %x, i64 2
+ %v = load i32, ptr %x2, align 1
ret void
}
; Leak through ret.
-define i8* @Ret() {
+define ptr @Ret() {
; CHECK-LABEL: @Ret dso_preemptable{{$}}
; CHECK-NEXT: args uses:
; CHECK-NEXT: allocas uses:
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- %x2 = getelementptr i8, i8* %x1, i64 2
- ret i8* %x2
+ %x2 = getelementptr i8, ptr %x, i64 2
+ ret ptr %x2
}
-declare void @Foo(i16* %p)
+declare void @Foo(ptr %p)
define void @DirectCall() {
; CHECK-LABEL: @DirectCall dso_preemptable{{$}}
; CHECK-EMPTY:
entry:
%x = alloca i64, align 4
- %x1 = bitcast i64* %x to i16*
- %x2 = getelementptr i16, i16* %x1, i64 1
- call void @Foo(i16* %x2);
+ %x2 = getelementptr i16, ptr %x, i64 1
+ call void @Foo(ptr %x2);
ret void
}
; Indirect calls can not be analyzed (yet).
; FIXME: %p[]: full-set looks invalid
-define void @IndirectCall(void (i8*)* %p) {
+define void @IndirectCall(ptr %p) {
; CHECK-LABEL: @IndirectCall dso_preemptable{{$}}
; CHECK-NEXT: args uses:
; CHECK-NEXT: p[]: full-set{{$}}
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- call void %p(i8* %x1);
+ call void %p(ptr %x);
ret void
}
; FIXME: SCEV can't look through selects.
; CHECK-NEXT: x[4]: [0,4){{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: store i8 0, i8* %x2, align 1
+; GLOBAL-NEXT: store i8 0, ptr %x2, align 1
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
%idx = select i1 %z, i64 1, i64 2
- %x2 = getelementptr i8, i8* %x1, i64 %idx
- store i8 0, i8* %x2, align 1
+ %x2 = getelementptr i8, ptr %x, i64 %idx
+ store i8 0, ptr %x2, align 1
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, i32 10, align 4
- %x2 = getelementptr i32, i32* %x, i64 -400000000000
- store i32 0, i32* %x2, align 1
+ %x2 = getelementptr i32, ptr %x, i64 -400000000000
+ store i32 0, ptr %x2, align 1
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, i32 10, align 4
- %x2 = getelementptr i32, i32* %x, i16 %z
- store i32 0, i32* %x2, align 1
+ %x2 = getelementptr i32, ptr %x, i16 %z
+ store i32 0, ptr %x2, align 1
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
%idx = select i1 %z, i64 1, i64 4
- %x2 = getelementptr i8, i8* %x1, i64 %idx
- store i8 0, i8* %x2, align 1
+ %x2 = getelementptr i8, ptr %x, i64 %idx
+ store i8 0, ptr %x2, align 1
ret void
}
; CHECK-NEXT: allocas uses:
; CHECK-NEXT: x[40]: [36,40){{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: store i32 0, i32* %x3, align 1
+; GLOBAL-NEXT: store i32 0, ptr %x2, align 1
; CHECK-EMPTY:
entry:
%x = alloca i32, i32 10, align 4
- %x1 = bitcast i32* %x to i8*
- %x2 = getelementptr i8, i8* %x1, i64 36
- %x3 = bitcast i8* %x2 to i32*
- store i32 0, i32* %x3, align 1
+ %x2 = getelementptr i8, ptr %x, i64 36
+ store i32 0, ptr %x2, align 1
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, i32 10, align 4
- %x1 = bitcast i32* %x to i8*
- %x2 = getelementptr i8, i8* %x1, i64 37
- %x3 = bitcast i8* %x2 to i32*
- store i32 0, i32* %x3, align 1
+ %x2 = getelementptr i8, ptr %x, i64 37
+ store i32 0, ptr %x2, align 1
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, i64 %size, align 16
- store i32 0, i32* %x, align 1
+ store i32 0, ptr %x, align 1
ret void
}
entry:
%size = select i1 %z, i64 3, i64 5
%x = alloca i32, i64 %size, align 16
- store i32 0, i32* %x, align 1
+ store i32 0, ptr %x, align 1
ret void
}
; CHECK-NEXT: allocas uses:
; CHECK-NEXT: x[10]: [0,10){{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: %load = load volatile i8, i8* %p.09, align 1
+; GLOBAL-NEXT: %load = load volatile i8, ptr %p.09, align 1
; CHECK-EMPTY:
entry:
%x = alloca [10 x i8], align 1
- %0 = getelementptr inbounds [10 x i8], [10 x i8]* %x, i64 0, i64 0
- %lftr.limit = getelementptr inbounds [10 x i8], [10 x i8]* %x, i64 0, i64 10
+ %lftr.limit = getelementptr inbounds [10 x i8], ptr %x, i64 0, i64 10
br label %for.body
for.body:
%sum.010 = phi i8 [ 0, %entry ], [ %add, %for.body ]
- %p.09 = phi i8* [ %0, %entry ], [ %incdec.ptr, %for.body ]
- %incdec.ptr = getelementptr inbounds i8, i8* %p.09, i64 1
- %load = load volatile i8, i8* %p.09, align 1
+ %p.09 = phi ptr [ %x, %entry ], [ %incdec.ptr, %for.body ]
+ %incdec.ptr = getelementptr inbounds i8, ptr %p.09, i64 1
+ %load = load volatile i8, ptr %p.09, align 1
%add = add i8 %load, %sum.010
- %exitcond = icmp eq i8* %incdec.ptr, %lftr.limit
+ %exitcond = icmp eq ptr %incdec.ptr, %lftr.limit
br i1 %exitcond, label %for.cond.cleanup, label %for.body
for.cond.cleanup:
; CHECK-EMPTY:
entry:
%x = alloca [10 x i8], align 1
- %0 = getelementptr inbounds [10 x i8], [10 x i8]* %x, i64 0, i64 0
; 11 iterations
- %lftr.limit = getelementptr inbounds [10 x i8], [10 x i8]* %x, i64 0, i64 11
+ %lftr.limit = getelementptr inbounds [10 x i8], ptr %x, i64 0, i64 11
br label %for.body
for.body:
%sum.010 = phi i8 [ 0, %entry ], [ %add, %for.body ]
- %p.09 = phi i8* [ %0, %entry ], [ %incdec.ptr, %for.body ]
- %incdec.ptr = getelementptr inbounds i8, i8* %p.09, i64 1
- %load = load volatile i8, i8* %p.09, align 1
+ %p.09 = phi ptr [ %x, %entry ], [ %incdec.ptr, %for.body ]
+ %incdec.ptr = getelementptr inbounds i8, ptr %p.09, i64 1
+ %load = load volatile i8, ptr %p.09, align 1
%add = add i8 %load, %sum.010
- %exitcond = icmp eq i8* %incdec.ptr, %lftr.limit
+ %exitcond = icmp eq ptr %incdec.ptr, %lftr.limit
br i1 %exitcond, label %for.cond.cleanup, label %for.body
for.cond.cleanup:
; CHECK-EMPTY:
entry:
%x1 = alloca [128 x i8], align 16
- %x1.sub = getelementptr inbounds [128 x i8], [128 x i8]* %x1, i64 0, i64 0
%cmp = icmp slt i32 %sz, 129
br i1 %cmp, label %if.then, label %if.end
if.then:
- call void @llvm.memset.p0i8.i32(i8* nonnull align 16 %x1.sub, i8 0, i32 %sz, i1 false)
+ call void @llvm.memset.p0.i32(ptr nonnull align 16 %x1, i8 0, i32 %sz, i1 false)
br label %if.end
if.end:
; FIXME: scalable allocas are considered to be of size zero, and scalable accesses to be full-range.
; This effectively disables safety analysis for scalable allocations.
-define void @Scalable(<vscale x 4 x i32>* %p, <vscale x 4 x i32>* %unused, <vscale x 4 x i32> %v) {
+define void @Scalable(ptr %p, ptr %unused, <vscale x 4 x i32> %v) {
; CHECK-LABEL: @Scalable dso_preemptable{{$}}
; CHECK-NEXT: args uses:
; CHECK-NEXT: p[]: full-set
; CHECK-NEXT: allocas uses:
; CHECK-NEXT: x[0]: [0,1){{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: store <vscale x 4 x i32> %v, <vscale x 4 x i32>* %p, align 4
+; GLOBAL-NEXT: store <vscale x 4 x i32> %v, ptr %p, align 4
; CHECK-EMPTY:
entry:
%x = alloca <vscale x 4 x i32>, align 4
- %x1 = bitcast <vscale x 4 x i32>* %x to i8*
- store i8 0, i8* %x1, align 1
- store <vscale x 4 x i32> %v, <vscale x 4 x i32>* %p, align 4
+ store i8 0, ptr %x, align 1
+ store <vscale x 4 x i32> %v, ptr %p, align 4
ret void
}
%zerosize_type = type {}
-define void @ZeroSize(%zerosize_type *%p) {
+define void @ZeroSize(ptr %p) {
; CHECK-LABEL: @ZeroSize dso_preemptable{{$}}
; CHECK-NEXT: args uses:
; CHECK-NEXT: p[]: empty-set
; CHECK-NEXT: allocas uses:
; CHECK-NEXT: x[0]: empty-set
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: store %zerosize_type undef, %zerosize_type* %x, align 4
-; GLOBAL-NEXT: store %zerosize_type undef, %zerosize_type* undef, align 4
-; GLOBAL-NEXT: load %zerosize_type, %zerosize_type* %p, align
+; GLOBAL-NEXT: store %zerosize_type undef, ptr %x, align 4
+; GLOBAL-NEXT: store %zerosize_type undef, ptr undef, align 4
+; GLOBAL-NEXT: load %zerosize_type, ptr %p, align
; CHECK-EMPTY:
entry:
%x = alloca %zerosize_type, align 4
- store %zerosize_type undef, %zerosize_type* %x, align 4
- store %zerosize_type undef, %zerosize_type* undef, align 4
- %val = load %zerosize_type, %zerosize_type* %p, align 4
+ store %zerosize_type undef, ptr %x, align 4
+ store %zerosize_type undef, ptr undef, align 4
+ %val = load %zerosize_type, ptr %p, align 4
ret void
}
; CHECK-EMPTY:
entry:
%a = alloca i32, align 4
- call void @LeakAddress() ["unknown"(i32* %a)]
+ call void @LeakAddress() ["unknown"(ptr %a)]
ret void
}
-define void @ByVal(i16* byval(i16) %p) {
+define void @ByVal(ptr byval(i16) %p) {
; CHECK-LABEL: @ByVal dso_preemptable{{$}}
; CHECK-NEXT: args uses:
; CHECK-NEXT: allocas uses:
; CHECK-NEXT: x[2]: [0,2)
; CHECK-NEXT: y[8]: [0,2)
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: call void @ByVal(i16* byval(i16) %x)
-; GLOBAL-NEXT: call void @ByVal(i16* byval(i16) %y1)
+; GLOBAL-NEXT: call void @ByVal(ptr byval(i16) %x)
+; GLOBAL-NEXT: call void @ByVal(ptr byval(i16) %y)
; CHECK-EMPTY:
entry:
%x = alloca i16, align 4
- call void @ByVal(i16* byval(i16) %x)
+ call void @ByVal(ptr byval(i16) %x)
%y = alloca i64, align 4
- %y1 = bitcast i64* %y to i16*
- call void @ByVal(i16* byval(i16) %y1)
+ call void @ByVal(ptr byval(i16) %y)
ret void
}
-declare void @ByValArray([100000 x i64]* byval([100000 x i64]) %p)
+declare void @ByValArray(ptr byval([100000 x i64]) %p)
define void @TestByValArray() {
; CHECK-LABEL: @TestByValArray dso_preemptable{{$}}
; CHECK-EMPTY:
entry:
%z = alloca [100000 x i64], align 4
- %z1 = bitcast [100000 x i64]* %z to i8*
- %z2 = getelementptr i8, i8* %z1, i64 500000
- %z3 = bitcast i8* %z2 to [100000 x i64]*
- call void @ByValArray([100000 x i64]* byval([100000 x i64]) %z3)
+ %z2 = getelementptr i8, ptr %z, i64 500000
+ call void @ByValArray(ptr byval([100000 x i64]) %z2)
ret void
}
-define dso_local i8 @LoadMinInt64(i8* %p) {
+define dso_local i8 @LoadMinInt64(ptr %p) {
; CHECK-LABEL: @LoadMinInt64{{$}}
; CHECK-NEXT: args uses:
; CHECK-NEXT: p[]: [-9223372036854775808,-9223372036854775807){{$}}
; CHECK-NEXT: allocas uses:
; GLOBAL-NEXT: safe accesses:
- ; GLOBAL-NEXT: load i8, i8* %p2, align 1
+ ; GLOBAL-NEXT: load i8, ptr %p2, align 1
; CHECK-EMPTY:
- %p2 = getelementptr i8, i8* %p, i64 -9223372036854775808
- %v = load i8, i8* %p2, align 1
+ %p2 = getelementptr i8, ptr %p, i64 -9223372036854775808
+ %v = load i8, ptr %p2, align 1
ret i8 %v
}
; CHECK-EMPTY:
entry:
%x = alloca i8, align 4
- %x2 = getelementptr i8, i8* %x, i64 -9223372036854775808
- %v = call i8 @LoadMinInt64(i8* %x2)
+ %x2 = getelementptr i8, ptr %x, i64 -9223372036854775808
+ %v = call i8 @LoadMinInt64(ptr %x2)
ret void
}
-define void @DeadBlock(i64* %p) {
+define void @DeadBlock(ptr %p) {
; CHECK-LABEL: @DeadBlock dso_preemptable{{$}}
; CHECK-NEXT: args uses:
; CHECK-NEXT: p[]: empty-set{{$}}
; CHECK-NEXT: allocas uses:
; CHECK-NEXT: x[1]: empty-set{{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: store i8 5, i8* %x
-; GLOBAL-NEXT: store i64 -5, i64* %p
+; GLOBAL-NEXT: store i8 5, ptr %x
+; GLOBAL-NEXT: store i64 -5, ptr %p
; CHECK-EMPTY:
entry:
%x = alloca i8, align 4
br label %end
dead:
- store i8 5, i8* %x
- store i64 -5, i64* %p
+ store i8 5, ptr %x
+ store i64 -5, ptr %p
br label %end
end:
%y = alloca i8, align 4
%z = alloca i8, align 4
- store i8 5, i8* %x
- %n = load i8, i8* %y
- call void @llvm.memset.p0i8.i32(i8* nonnull %z, i8 0, i32 1, i1 false)
+ store i8 5, ptr %x
+ %n = load i8, ptr %y
+ call void @llvm.memset.p0.i32(ptr nonnull %z, i8 0, i32 1, i1 false)
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %y)
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %z)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %x)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %y)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %z)
ret void
}
; CHECK: y[1]: [0,1){{$}}
; CHECK: z[1]: [0,1){{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: store i8 5, i8* %x
-; GLOBAL-NEXT: %n = load i8, i8* %y
-; GLOBAL-NEXT: call void @llvm.memset.p0i8.i32(i8* nonnull %z, i8 0, i32 1, i1 false)
+; GLOBAL-NEXT: store i8 5, ptr %x
+; GLOBAL-NEXT: %n = load i8, ptr %y
+; GLOBAL-NEXT: call void @llvm.memset.p0.i32(ptr nonnull %z, i8 0, i32 1, i1 false)
; CHECK-EMPTY:
entry:
%x = alloca i8, align 4
%y = alloca i8, align 4
%z = alloca i8, align 4
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %y)
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %z)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %x)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %y)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %z)
- store i8 5, i8* %x
- %n = load i8, i8* %y
- call void @llvm.memset.p0i8.i32(i8* nonnull %z, i8 0, i32 1, i1 false)
+ store i8 5, ptr %x
+ %n = load i8, ptr %y
+ call void @llvm.memset.p0.i32(ptr nonnull %z, i8 0, i32 1, i1 false)
ret void
}
%y = alloca i8, align 4
%z = alloca i8, align 4
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %y)
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %z)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %x)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %y)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %z)
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %x)
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %y)
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %z)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %x)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %y)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %z)
- store i8 5, i8* %x
- %n = load i8, i8* %y
- call void @llvm.memset.p0i8.i32(i8* nonnull %z, i8 0, i32 1, i1 false)
+ store i8 5, ptr %x
+ %n = load i8, ptr %y
+ call void @llvm.memset.p0.i32(ptr nonnull %z, i8 0, i32 1, i1 false)
ret void
}
; CHECK: a[4]: [0,1){{$}}
; CHECK: y[1]: [0,1){{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %y, i8* %x, i32 1, i1 false)
+; GLOBAL-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr %y, ptr %a, i32 1, i1 false)
; CHECK-EMPTY:
entry:
%a = alloca i32, align 4
- %x = bitcast i32* %a to i8*
%y = alloca i8, align 4
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %y, i8* %x, i32 1, i1 false)
+ call void @llvm.memcpy.p0.p0.i32(ptr %y, ptr %a, i32 1, i1 false)
ret void
}
; CHECK-EMPTY:
entry:
%a = alloca i32, align 4
- %x = bitcast i32* %a to i8*
%y = alloca i8, align 4
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %y, i8* %x, i32 4, i1 false)
+ call void @llvm.memcpy.p0.p0.i32(ptr %y, ptr %a, i32 4, i1 false)
ret void
}
; CHECK-EMPTY:
entry:
%a = alloca i32, align 4
- %x = bitcast i32* %a to i8*
%y = alloca i8, align 4
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x, i8* %y, i32 4, i1 false)
+ call void @llvm.memcpy.p0.p0.i32(ptr %a, ptr %y, i32 4, i1 false)
ret void
}
; CHECK-EMPTY:
entry:
%a = alloca i32, align 4
- %x = bitcast i32* %a to i8*
%y = alloca i8, align 4
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %y, i8* %x, i32 5, i1 false)
+ call void @llvm.memcpy.p0.p0.i32(ptr %y, ptr %a, i32 5, i1 false)
ret void
}
; CHECK-NEXT: allocas uses:
; CHECK: a[4]: [0,5){{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: call void @llvm.memset.p0i8.i32(i8* %x, i8 1, i32 4, i1 false)
+; GLOBAL-NEXT: call void @llvm.memset.p0.i32(ptr %a, i8 1, i32 4, i1 false)
; CHECK-EMPTY:
entry:
%a = alloca i32, align 4
- %x = bitcast i32* %a to i8*
- call void @llvm.memset.p0i8.i32(i8* %x, i8 1, i32 5, i1 false)
- call void @llvm.memset.p0i8.i32(i8* %x, i8 1, i32 4, i1 false)
+ call void @llvm.memset.p0.i32(ptr %a, i8 1, i32 5, i1 false)
+ call void @llvm.memset.p0.i32(ptr %a, i8 1, i32 4, i1 false)
ret void
}
; CHECK-NEXT: allocas uses:
; CHECK: a[4]: [0,8){{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: load i32, i32* %a, align 4
+; GLOBAL-NEXT: load i32, ptr %a, align 4
; CHECK-EMPTY:
entry:
%a = alloca i32, align 4
- %a1 = bitcast i32* %a to i64*
- %n1 = load i64, i64* %a1, align 4
- %n2 = load i32, i32* %a, align 4
+ %n1 = load i64, ptr %a, align 4
+ %n2 = load i32, ptr %a, align 4
ret void
}
-define void @MixedAccesses3(void (i8*)* %func) {
+define void @MixedAccesses3(ptr %func) {
; CHECK-LABEL: @MixedAccesses3
; CHECK-NEXT: args uses:
; CHECK-NEXT: func[]: full-set
; CHECK-NEXT: allocas uses:
; CHECK: a[4]: full-set{{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: load i32, i32* %a, align 4
+; GLOBAL-NEXT: load i32, ptr %a, align 4
; CHECK-EMPTY:
entry:
%a = alloca i32, align 4
- %x = bitcast i32* %a to i8*
- %n2 = load i32, i32* %a, align 4
- call void %func(i8* %x)
+ %n2 = load i32, ptr %a, align 4
+ call void %func(ptr %a)
ret void
}
; CHECK: a[4]: full-set{{$}}
; CHECK: a1[8]: [0,8){{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: load i32, i32* %a, align 4
+; GLOBAL-NEXT: load i32, ptr %a, align 4
; CHECK-EMPTY:
entry:
%a = alloca i32, align 4
- %a1 = alloca i32*, align 4
- %n2 = load i32, i32* %a, align 4
- store i32* %a, i32** %a1
+ %a1 = alloca ptr, align 4
+ %n2 = load i32, ptr %a, align 4
+ store ptr %a, ptr %a1
ret void
}
-define i32* @MixedAccesses5(i1 %x, i32* %y) {
+define ptr @MixedAccesses5(i1 %x, ptr %y) {
; CHECK-LABEL: @MixedAccesses5
; CHECK-NEXT: args uses:
; CHECK: y[]: full-set
; CHECK-NEXT: allocas uses:
; CHECK: a[4]: full-set{{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: load i32, i32* %a, align 4
+; GLOBAL-NEXT: load i32, ptr %a, align 4
; CHECK-EMPTY:
entry:
%a = alloca i32, align 4
br i1 %x, label %tlabel, label %flabel
flabel:
- %n = load i32, i32* %a, align 4
- ret i32* %y
+ %n = load i32, ptr %a, align 4
+ ret ptr %y
tlabel:
- ret i32* %a
+ ret ptr %a
}
-define void @MixedAccesses6(i8* %arg) {
+define void @MixedAccesses6(ptr %arg) {
; CHECK-LABEL: @MixedAccesses6
; CHECK-NEXT: args uses:
; CHECK-NEXT: arg[]: [0,4)
; CHECK-NEXT: allocas uses:
; CHECK: a[4]: [0,4)
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x, i8* %arg, i32 4, i1 false)
+; GLOBAL-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr %a, ptr %arg, i32 4, i1 false)
; CHECK-EMPTY:
entry:
%a = alloca i32, align 4
- %x = bitcast i32* %a to i8*
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x, i8* %arg, i32 4, i1 false)
+ call void @llvm.memcpy.p0.p0.i32(ptr %a, ptr %arg, i32 4, i1 false)
ret void
}
-define void @MixedAccesses7(i1 %cond, i8* %arg) {
+define void @MixedAccesses7(i1 %cond, ptr %arg) {
; SECV doesn't support select, so we consider this non-stack-safe, even through
; it is.
;
; CHECK-EMPTY:
entry:
%a = alloca i32, align 4
- %x = bitcast i32* %a to i8*
- %x1 = select i1 %cond, i8* %arg, i8* %x
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x1, i8* %arg, i32 4, i1 false)
+ %x1 = select i1 %cond, ptr %arg, ptr %a
+ call void @llvm.memcpy.p0.p0.i32(ptr %x1, ptr %arg, i32 4, i1 false)
ret void
}
-define void @NoStackAccess(i8* %arg1, i8* %arg2) {
+define void @NoStackAccess(ptr %arg1, ptr %arg2) {
; CHECK-LABEL: @NoStackAccess
; CHECK-NEXT: args uses:
; CHECK-NEXT: arg1[]: [0,4)
; CHECK-NEXT: allocas uses:
; CHECK: a[4]: empty-set{{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %arg1, i8* %arg2, i32 4, i1 false)
+; GLOBAL-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr %arg1, ptr %arg2, i32 4, i1 false)
; CHECK-EMPTY:
entry:
%a = alloca i32, align 4
- %x = bitcast i32* %a to i8*
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %arg1, i8* %arg2, i32 4, i1 false)
+ call void @llvm.memcpy.p0.p0.i32(ptr %arg1, ptr %arg2, i32 4, i1 false)
ret void
}
; CHECK-NEXT: allocas uses:
; CHECK: a[4]: full-set{{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: call void @llvm.memset.p0i8.i32(i8* %x, i8 1, i32 4, i1 false)
+; GLOBAL-NEXT: call void @llvm.memset.p0.i32(ptr %a, i8 1, i32 4, i1 false)
; CHECK-EMPTY:
entry:
%a = alloca i32, align 4
- %x = bitcast i32* %a to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %x)
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %x)
- call void @llvm.memset.p0i8.i32(i8* %x, i8 1, i32 4, i1 true)
-
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %x)
- call void @llvm.memset.p0i8.i32(i8* %x, i8 1, i32 4, i1 false)
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %x)
+ call void @llvm.lifetime.start.p0(i64 4, ptr %a)
+ call void @llvm.lifetime.end.p0(i64 4, ptr %a)
+ call void @llvm.memset.p0.i32(ptr %a, i8 1, i32 4, i1 true)
+
+ call void @llvm.lifetime.start.p0(i64 4, ptr %a)
+ call void @llvm.memset.p0.i32(ptr %a, i8 1, i32 4, i1 false)
+ call void @llvm.lifetime.end.p0(i64 4, ptr %a)
ret void
}
; CHECK-NEXT: allocas uses:
; CHECK: a[4]: full-set{{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: call void @llvm.memset.p0i8.i32(i8* %x, i8 1, i32 4, i1 false)
+; GLOBAL-NEXT: call void @llvm.memset.p0.i32(ptr %a, i8 1, i32 4, i1 false)
; CHECK-EMPTY:
entry:
%a = alloca i32, align 4
- %x = bitcast i32* %a to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %x)
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %x)
- %n = load i32, i32* %a
-
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %x)
- call void @llvm.memset.p0i8.i32(i8* %x, i8 1, i32 4, i1 false)
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %x)
+ call void @llvm.lifetime.start.p0(i64 4, ptr %a)
+ call void @llvm.lifetime.end.p0(i64 4, ptr %a)
+ %n = load i32, ptr %a
+
+ call void @llvm.lifetime.start.p0(i64 4, ptr %a)
+ call void @llvm.memset.p0.i32(ptr %a, i8 1, i32 4, i1 false)
+ call void @llvm.lifetime.end.p0(i64 4, ptr %a)
ret void
}
; CHECK-NEXT: allocas uses:
; CHECK: a[4]: full-set{{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: call void @llvm.memset.p0i8.i32(i8* %x, i8 1, i32 4, i1 false)
+; GLOBAL-NEXT: call void @llvm.memset.p0.i32(ptr %a, i8 1, i32 4, i1 false)
; CHECK-EMPTY:
entry:
%a = alloca i32, align 4
- %x = bitcast i32* %a to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %x)
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %x)
- store i32 5, i32* %a
-
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %x)
- call void @llvm.memset.p0i8.i32(i8* %x, i8 1, i32 4, i1 false)
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %x)
+ call void @llvm.lifetime.start.p0(i64 4, ptr %a)
+ call void @llvm.lifetime.end.p0(i64 4, ptr %a)
+ store i32 5, ptr %a
+
+ call void @llvm.lifetime.start.p0(i64 4, ptr %a)
+ call void @llvm.memset.p0.i32(ptr %a, i8 1, i32 4, i1 false)
+ call void @llvm.lifetime.end.p0(i64 4, ptr %a)
ret void
}
; CHECK-NEXT: allocas uses:
; CHECK: a[4]: full-set{{$}}
; GLOBAL-NEXT: safe accesses:
-; GLOBAL-NEXT: call void @llvm.memset.p0i8.i32(i8* %x, i8 1, i32 4, i1 false)
+; GLOBAL-NEXT: call void @llvm.memset.p0.i32(ptr %a, i8 1, i32 4, i1 false)
; CHECK-EMPTY:
entry:
%a = alloca i32, align 4
- %x = bitcast i32* %a to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %x)
- call void @llvm.memset.p0i8.i32(i8* %x, i8 1, i32 4, i1 false)
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %x)
- call void @unknown_call(i8* %x)
+ call void @llvm.lifetime.start.p0(i64 4, ptr %a)
+ call void @llvm.memset.p0.i32(ptr %a, i8 1, i32 4, i1 false)
+ call void @llvm.lifetime.end.p0(i64 4, ptr %a)
+ call void @unknown_call(ptr %a)
ret void
}
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture)
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
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.p0i8.i32(i8* %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.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i1 %isvolatile)
+declare void @llvm.memset.p0.i64(ptr %dest, i8 %val, i64 %len, i1 %isvolatile)
+declare void @llvm.memset.p0.i32(ptr %dest, i8 %val, i32 %len, i1 %isvolatile)
+declare void @llvm.memcpy.p0.p0.i32(ptr %dest, ptr %src, i32 %len, i1 %isvolatile)
+declare void @llvm.memmove.p0.p0.i32(ptr %dest, ptr %src, i32 %len, i1 %isvolatile)
define void @MemsetInBounds() {
; CHECK-LABEL: MemsetInBounds dso_preemptable{{$}}
; CHECK-NEXT: allocas uses:
; CHECK-NEXT: x[4]: [0,4){{$}}
; 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:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- call void @llvm.memset.p0i8.i32(i8* %x1, i8 42, i32 4, i1 false)
+ call void @llvm.memset.p0.i32(ptr %x, i8 42, i32 4, i1 false)
ret void
}
; CHECK-NEXT: allocas uses:
; CHECK-NEXT: x[4]: [0,4){{$}}
; 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:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- call void @llvm.memset.p0i8.i32(i8* %x1, i8 42, i32 4, i1 true)
+ call void @llvm.memset.p0.i32(ptr %x, i8 42, i32 4, i1 true)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- call void @llvm.memset.p0i8.i32(i8* %x1, i8 42, i32 5, i1 false)
+ call void @llvm.memset.p0.i32(ptr %x, i8 42, i32 5, i1 false)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- 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
}
; CHECK-EMPTY:
entry:
%x = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
%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
}
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- %xint = ptrtoint i32* %x to i32
- %yint = ptrtoint i32* %y to i32
+ %xint = ptrtoint ptr %x to i32
+ %yint = ptrtoint ptr %y to i32
%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
}
; CHECK-NEXT: x[4]: [0,4){{$}}
; CHECK-NEXT: y[4]: [0,4){{$}}
; 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:
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
- %x1 = bitcast i32* %x to i8*
- %y1 = bitcast i32* %y to i8*
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x1, i8* %y1, i32 4, i1 false)
+ call void @llvm.memcpy.p0.p0.i32(ptr %x, ptr %y, i32 4, i1 false)
ret void
}
entry:
%x = alloca i64, align 4
%y = alloca i32, align 4
- %x1 = bitcast i64* %x to i8*
- %y1 = bitcast i32* %y to i8*
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x1, i8* %y1, i32 5, i1 false)
+ call void @llvm.memcpy.p0.p0.i32(ptr %x, ptr %y, i32 5, i1 false)
ret void
}
entry:
%x = alloca i32, align 4
%y = alloca i64, align 4
- %x1 = bitcast i32* %x to i8*
- %y1 = bitcast i64* %y to i8*
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x1, i8* %y1, i32 5, i1 false)
+ call void @llvm.memcpy.p0.p0.i32(ptr %x, ptr %y, i32 5, i1 false)
ret void
}
entry:
%x = alloca i32, align 4
%y = alloca i64, align 4
- %x1 = bitcast i32* %x to i8*
- %y1 = bitcast i64* %y to i8*
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x1, i8* %y1, i32 9, i1 false)
+ call void @llvm.memcpy.p0.p0.i32(ptr %x, ptr %y, i32 9, i1 false)
ret void
}
; CHECK-NEXT: allocas uses:
; CHECK-NEXT: x[8]: [0,8){{$}}
; 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:
entry:
%x = alloca i64, align 4
- %x1 = bitcast i64* %x to i8*
- %x2 = getelementptr i8, i8* %x1, i64 5
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x1, i8* %x2, i32 3, i1 false)
+ %x2 = getelementptr i8, ptr %x, i64 5
+ call void @llvm.memcpy.p0.p0.i32(ptr %x, ptr %x2, i32 3, i1 false)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i64, align 4
- %x1 = bitcast i64* %x to i8*
- %x2 = getelementptr i8, i8* %x1, i64 5
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x1, i8* %x2, i32 4, i1 false)
+ %x2 = getelementptr i8, ptr %x, i64 5
+ call void @llvm.memcpy.p0.p0.i32(ptr %x, ptr %x2, i32 4, i1 false)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i64, align 4
- %x1 = bitcast i64* %x to i8*
- %x2 = getelementptr i8, i8* %x1, i64 5
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x2, i8* %x1, i32 4, i1 false)
+ %x2 = getelementptr i8, ptr %x, i64 5
+ call void @llvm.memcpy.p0.p0.i32(ptr %x2, ptr %x, i32 4, i1 false)
ret void
}
; CHECK-EMPTY:
entry:
%x = alloca i64, align 4
- %x1 = bitcast i64* %x to i8*
- %x2 = getelementptr i8, i8* %x1, i64 5
- call void @llvm.memmove.p0i8.p0i8.i32(i8* %x1, i8* %x2, i32 9, i1 false)
+ %x2 = getelementptr i8, ptr %x, i64 5
+ call void @llvm.memmove.p0.p0.i32(ptr %x, ptr %x2, i32 9, i1 false)
ret void
}
; CHECK-NEXT: x[4]: [0,4){{$}}
; CHECK-NEXT: y[1]: empty-set{{$}}
; 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:
entry:
%x = alloca i32, align 4
%y = alloca i8, align 1
- %x1 = bitcast i32* %x to i8*
- %yint = ptrtoint i8* %y to i8
- call void @llvm.memset.p0i8.i32(i8* %x1, i8 %yint, i32 4, i1 false)
+ %yint = ptrtoint ptr %y to i8
+ call void @llvm.memset.p0.i32(ptr %x, i8 %yint, i32 4, i1 false)
ret void
}
; CHECK-NEXT: y[256]: [0,255){{$}}
; CHECK-NEXT: z[1]: empty-set{{$}}
; 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:
entry:
%x = alloca [256 x i8], align 4
%y = alloca [256 x i8], align 4
%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
- 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
}