From 7cf5581712b24d4aea5dffa2e23f0ed42af1954d Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Fri, 2 Dec 2022 17:25:57 -0500 Subject: [PATCH] Analysis: Update some tests for opaque pointers StackSafetyAnalysis/lifetime.ll had one bitcast removed that may have mattered. The concluded lifetime is longer based on the underlying alloca, instead of the bitcasted pointer so left that as a pointless cast. local.ll memintrin.ll needed some manual fixes --- llvm/test/Analysis/BranchProbabilityInfo/basic.ll | 32 +- .../Analysis/BranchProbabilityInfo/deopt-invoke.ll | 20 +- .../Analysis/BranchProbabilityInfo/libfunc_call.ll | 74 +-- llvm/test/Analysis/BranchProbabilityInfo/loop.ll | 50 +- .../Analysis/BranchProbabilityInfo/noreturn.ll | 16 +- .../BranchProbabilityInfo/pointer_heuristics.ll | 24 +- .../test/Analysis/BranchProbabilityInfo/pr18705.ll | 36 +- .../test/Analysis/BranchProbabilityInfo/pr22718.ll | 30 +- .../BranchProbabilityInfo/zero_heuristics.ll | 36 +- .../Analysis/CallGraph/2008-09-09-DirectCall.ll | 2 +- .../Analysis/CallGraph/2008-09-09-UsedByGlobal.ll | 2 +- llvm/test/Analysis/CallGraph/callback-calls.ll | 8 +- .../Analysis/CallGraph/ignore-callback-uses.ll | 16 +- llvm/test/Analysis/CallGraph/llvm-used.ll | 6 +- llvm/test/Analysis/CallGraph/no-intrinsics.ll | 6 +- .../test/Analysis/CallGraph/non-leaf-intrinsics.ll | 4 +- llvm/test/Analysis/DDG/basic-a.ll | 48 +- llvm/test/Analysis/DDG/basic-b.ll | 56 +- llvm/test/Analysis/DDG/basic-loopnest.ll | 76 +-- llvm/test/Analysis/DDG/print-dot-ddg.ll | 34 +- llvm/test/Analysis/DDG/root-node.ll | 12 +- llvm/test/Analysis/MustExecute/infinite_loops.ll | 6 +- llvm/test/Analysis/MustExecute/loop-header.ll | 30 +- .../MustExecute/must_be_executed_context.ll | 66 +-- llvm/test/Analysis/PhiValues/basic.ll | 4 +- llvm/test/Analysis/PhiValues/big_phi.ll | 14 +- llvm/test/Analysis/PhiValues/long_phi_chain.ll | 62 +-- llvm/test/Analysis/PostDominators/infinite-loop.ll | 4 +- .../test/Analysis/PostDominators/infinite-loop2.ll | 6 +- .../test/Analysis/PostDominators/infinite-loop3.ll | 6 +- .../ScopedNoAliasAA/alias-scope-merging.ll | 20 +- .../test/Analysis/ScopedNoAliasAA/basic-domains.ll | 44 +- llvm/test/Analysis/ScopedNoAliasAA/basic.ll | 24 +- llvm/test/Analysis/ScopedNoAliasAA/basic2.ll | 36 +- .../StackSafetyAnalysis/Inputs/ipa-alias.ll | 20 +- .../Analysis/StackSafetyAnalysis/Inputs/ipa.ll | 116 ++-- .../Analysis/StackSafetyAnalysis/i386-bug-fix.ll | 6 +- .../test/Analysis/StackSafetyAnalysis/ipa-alias.ll | 28 +- llvm/test/Analysis/StackSafetyAnalysis/ipa.ll | 185 +++---- llvm/test/Analysis/StackSafetyAnalysis/lifetime.ll | 610 ++++++++++----------- llvm/test/Analysis/StackSafetyAnalysis/local.ll | 461 +++++++--------- .../test/Analysis/StackSafetyAnalysis/memintrin.ll | 87 ++- 42 files changed, 1146 insertions(+), 1277 deletions(-) diff --git a/llvm/test/Analysis/BranchProbabilityInfo/basic.ll b/llvm/test/Analysis/BranchProbabilityInfo/basic.ll index 44a626c..682de24 100644 --- a/llvm/test/Analysis/BranchProbabilityInfo/basic.ll +++ b/llvm/test/Analysis/BranchProbabilityInfo/basic.ll @@ -1,6 +1,6 @@ ; RUN: opt < %s -passes='print' -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 @@ -9,8 +9,8 @@ entry: 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 @@ -197,7 +197,7 @@ exit: !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 @@ -209,8 +209,8 @@ define i32 @test_cold_call_sites(i32* %a) { ; 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 @@ -220,8 +220,8 @@ then: 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 @@ -231,7 +231,7 @@ 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 @@ -251,7 +251,7 @@ invoke.cont: br label %if.end lpad: - %ll = landingpad { i8*, i32 } + %ll = landingpad { ptr, i32 } cleanup br label %if.end @@ -260,7 +260,7 @@ 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 @@ -277,7 +277,7 @@ invoke.cont: br label %if.end lpad: - %ll = landingpad { i8*, i32 } + %ll = landingpad { ptr, i32 } cleanup call void @ColdFunc() #0 br label %if.end @@ -287,7 +287,7 @@ 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% @@ -306,7 +306,7 @@ invoke.cont: br label %if.end lpad: - %ll = landingpad { i8*, i32 } + %ll = landingpad { ptr, i32 } cleanup call void @ColdFunc() #0 br label %if.end @@ -316,7 +316,7 @@ 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% @@ -339,7 +339,7 @@ invoke.to2: ret void lpad: - %ll = landingpad { i8*, i32 } + %ll = landingpad { ptr, i32 } cleanup ret void } diff --git a/llvm/test/Analysis/BranchProbabilityInfo/deopt-invoke.ll b/llvm/test/Analysis/BranchProbabilityInfo/deopt-invoke.ll index 8afb3c5..ae46ed7 100644 --- a/llvm/test/Analysis/BranchProbabilityInfo/deopt-invoke.ll +++ b/llvm/test/Analysis/BranchProbabilityInfo/deopt-invoke.ll @@ -1,6 +1,6 @@ ; RUN: opt < %s -passes='print' -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(...) @@ -8,7 +8,7 @@ declare void @cold() cold ; 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% @@ -28,9 +28,9 @@ unreached: 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: @@ -38,7 +38,7 @@ 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] @@ -58,9 +58,9 @@ unreached: 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: @@ -68,7 +68,7 @@ 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] @@ -87,9 +87,9 @@ unreached: 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 diff --git a/llvm/test/Analysis/BranchProbabilityInfo/libfunc_call.ll b/llvm/test/Analysis/BranchProbabilityInfo/libfunc_call.ll index b0539fe..7b38f9e 100644 --- a/llvm/test/Analysis/BranchProbabilityInfo/libfunc_call.ll +++ b/llvm/test/Analysis/BranchProbabilityInfo/libfunc_call.ll @@ -1,21 +1,21 @@ ; RUN: opt < %s -passes='print' -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% @@ -34,10 +34,10 @@ exit: 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% @@ -56,10 +56,10 @@ exit: 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% @@ -78,10 +78,10 @@ exit: 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% @@ -100,10 +100,10 @@ exit: 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% @@ -125,10 +125,10 @@ exit: ; 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% @@ -147,10 +147,10 @@ exit: 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% @@ -169,10 +169,10 @@ exit: 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% @@ -191,10 +191,10 @@ exit: 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% @@ -218,10 +218,10 @@ exit: ; 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% @@ -240,10 +240,10 @@ exit: 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% @@ -262,10 +262,10 @@ exit: 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% @@ -285,10 +285,10 @@ exit: } -define i32 @test_bcmp_eq(i8* %p, i8* %q) { +define i32 @test_bcmp_eq(ptr %p, ptr %q) { ; CHECK: Printing analysis {{.*}} for function 'test_bcmp_eq' 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% @@ -307,10 +307,10 @@ exit: 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% @@ -331,10 +331,10 @@ exit: -define i32 @test_bcmp_ne(i8* %p, i8* %q) { +define i32 @test_bcmp_ne(ptr %p, ptr %q) { ; CHECK: Printing analysis {{.*}} for function 'test_bcmp_ne' 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% diff --git a/llvm/test/Analysis/BranchProbabilityInfo/loop.ll b/llvm/test/Analysis/BranchProbabilityInfo/loop.ll index 7ebccd3..c2aa705 100644 --- a/llvm/test/Analysis/BranchProbabilityInfo/loop.ll +++ b/llvm/test/Analysis/BranchProbabilityInfo/loop.ll @@ -81,7 +81,7 @@ for.end6: 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] @@ -89,7 +89,7 @@ entry: 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% @@ -117,7 +117,7 @@ do.end6: 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] @@ -125,7 +125,7 @@ entry: 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% @@ -157,7 +157,7 @@ return: 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] @@ -170,7 +170,7 @@ do.body: 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% @@ -201,7 +201,7 @@ return: 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] @@ -215,7 +215,7 @@ do.body: 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% @@ -245,7 +245,7 @@ return: 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 @@ -259,7 +259,7 @@ for.body.lr.ph: 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% @@ -297,7 +297,7 @@ for.end7: 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 @@ -306,8 +306,8 @@ entry: 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] @@ -320,21 +320,21 @@ for.body: 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% @@ -403,7 +403,7 @@ end: ; 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] @@ -421,8 +421,8 @@ for.cond.cleanup: 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 @@ -430,7 +430,7 @@ for.body: ; 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] @@ -444,7 +444,7 @@ for.inc: ; 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] @@ -463,15 +463,15 @@ for.cond.cleanup: 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] @@ -510,7 +510,7 @@ invoke.cont: ; CHECK: edge invoke.cont -> exit probability is 0x04000000 / 0x80000000 = 3.12% lpad: - %ll = landingpad { i8*, i32 } + %ll = landingpad { ptr, i32 } cleanup br label %exit diff --git a/llvm/test/Analysis/BranchProbabilityInfo/noreturn.ll b/llvm/test/Analysis/BranchProbabilityInfo/noreturn.ll index 27d3c44..e4bcdfc 100644 --- a/llvm/test/Analysis/BranchProbabilityInfo/noreturn.ll +++ b/llvm/test/Analysis/BranchProbabilityInfo/noreturn.ll @@ -103,11 +103,11 @@ 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 @@ -115,18 +115,18 @@ entry: ; 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 @@ -137,13 +137,13 @@ if.end: ; preds = %entry @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) diff --git a/llvm/test/Analysis/BranchProbabilityInfo/pointer_heuristics.ll b/llvm/test/Analysis/BranchProbabilityInfo/pointer_heuristics.ll index f737423..278a656 100644 --- a/llvm/test/Analysis/BranchProbabilityInfo/pointer_heuristics.ll +++ b/llvm/test/Analysis/BranchProbabilityInfo/pointer_heuristics.ll @@ -1,19 +1,19 @@ ; RUN: opt < %s -passes='print' -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] @@ -22,20 +22,20 @@ define i32 @cmp1(i32* readnone %0, i32* readnone %1) { 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] @@ -45,19 +45,19 @@ define i32 @cmp2(i32* readnone %0, i32* readnone %1) { } ; 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] diff --git a/llvm/test/Analysis/BranchProbabilityInfo/pr18705.ll b/llvm/test/Analysis/BranchProbabilityInfo/pr18705.ll index 9e7e5e2..677c5fd 100644 --- a/llvm/test/Analysis/BranchProbabilityInfo/pr18705.ll +++ b/llvm/test/Analysis/BranchProbabilityInfo/pr18705.ll @@ -7,7 +7,7 @@ ; 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 @@ -18,36 +18,36 @@ 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 diff --git a/llvm/test/Analysis/BranchProbabilityInfo/pr22718.ll b/llvm/test/Analysis/BranchProbabilityInfo/pr22718.ll index 14ab8d8..d0fb641 100644 --- a/llvm/test/Analysis/BranchProbabilityInfo/pr22718.ll +++ b/llvm/test/Analysis/BranchProbabilityInfo/pr22718.ll @@ -16,15 +16,15 @@ define i32 @main() #0 { 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 @@ -37,30 +37,30 @@ for.body: ; preds = %for.cond 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 } @@ -70,7 +70,7 @@ declare void @srand(i32) #1 ; 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" } diff --git a/llvm/test/Analysis/BranchProbabilityInfo/zero_heuristics.ll b/llvm/test/Analysis/BranchProbabilityInfo/zero_heuristics.ll index 92ceaec..2f5a76b 100644 --- a/llvm/test/Analysis/BranchProbabilityInfo/zero_heuristics.ll +++ b/llvm/test/Analysis/BranchProbabilityInfo/zero_heuristics.ll @@ -4,10 +4,10 @@ @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% @@ -15,15 +15,15 @@ entry: 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: @@ -37,10 +37,10 @@ exit: } ; 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% @@ -48,15 +48,15 @@ entry: 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: @@ -70,10 +70,10 @@ exit: } ; 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% @@ -81,15 +81,15 @@ entry: 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: diff --git a/llvm/test/Analysis/CallGraph/2008-09-09-DirectCall.ll b/llvm/test/Analysis/CallGraph/2008-09-09-DirectCall.ll index 56eac49..a8dbfdf 100644 --- a/llvm/test/Analysis/CallGraph/2008-09-09-DirectCall.ll +++ b/llvm/test/Analysis/CallGraph/2008-09-09-DirectCall.ll @@ -12,6 +12,6 @@ entry: define void @caller() { entry: - call void (...) @callee( void (...)* @callee ) + call void (...) @callee( ptr @callee ) unreachable } diff --git a/llvm/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll b/llvm/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll index ac95188..e6aaab9 100644 --- a/llvm/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll +++ b/llvm/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll @@ -1,6 +1,6 @@ ; RUN: opt < %s -print-callgraph -disable-output 2>&1 | FileCheck %s -@a = global void ()* @f ; [#uses=0] +@a = global ptr @f ; [#uses=0] ; CHECK: calls function 'f' diff --git a/llvm/test/Analysis/CallGraph/callback-calls.ll b/llvm/test/Analysis/CallGraph/callback-calls.ll index b152dea..b5d61c7 100644 --- a/llvm/test/Analysis/CallGraph/callback-calls.ll +++ b/llvm/test/Analysis/CallGraph/callback-calls.ll @@ -5,16 +5,16 @@ ; CHECK-NEXT: CS<{{.*}}> calls function 'broker' ; CHECK-NEXT: CS 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} diff --git a/llvm/test/Analysis/CallGraph/ignore-callback-uses.ll b/llvm/test/Analysis/CallGraph/ignore-callback-uses.ll index 8964ca1..796391d 100644 --- a/llvm/test/Analysis/CallGraph/ignore-callback-uses.ll +++ b/llvm/test/Analysis/CallGraph/ignore-callback-uses.ll @@ -4,10 +4,10 @@ ; 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() { @@ -15,7 +15,7 @@ entry: 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 @@ -23,12 +23,12 @@ 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 @@ -45,7 +45,7 @@ omp.par.outlined.exit: ; preds = %omp.par.pre_finaliz } ; 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} diff --git a/llvm/test/Analysis/CallGraph/llvm-used.ll b/llvm/test/Analysis/CallGraph/llvm-used.ll index 09d4e95..89f82b9 100644 --- a/llvm/test/Analysis/CallGraph/llvm-used.ll +++ b/llvm/test/Analysis/CallGraph/llvm-used.ll @@ -17,9 +17,9 @@ ; 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: diff --git a/llvm/test/Analysis/CallGraph/no-intrinsics.ll b/llvm/test/Analysis/CallGraph/no-intrinsics.ll index 3d94103..a94c91e 100644 --- a/llvm/test/Analysis/CallGraph/no-intrinsics.ll +++ b/llvm/test/Analysis/CallGraph/no-intrinsics.ll @@ -3,10 +3,10 @@ ; 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 } diff --git a/llvm/test/Analysis/CallGraph/non-leaf-intrinsics.ll b/llvm/test/Analysis/CallGraph/non-leaf-intrinsics.ll index 9aec2a4..55f2496 100644 --- a/llvm/test/Analysis/CallGraph/non-leaf-intrinsics.ll +++ b/llvm/test/Analysis/CallGraph/non-leaf-intrinsics.ll @@ -1,7 +1,7 @@ ; 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 @@ -10,7 +10,7 @@ define private void @f() { 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 } diff --git a/llvm/test/Analysis/DDG/basic-a.ll b/llvm/test/Analysis/DDG/basic-a.ll index 5587178..6e7e403 100644 --- a/llvm/test/Analysis/DDG/basic-a.ll +++ b/llvm/test/Analysis/DDG/basic-a.ll @@ -29,14 +29,14 @@ ; 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]*]] @@ -54,29 +54,29 @@ ; 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 @@ -116,22 +116,22 @@ for.end: ; preds = %test1.for.body, %en ; 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]] @@ -143,31 +143,31 @@ for.end: ; preds = %test1.for.body, %en ; 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 diff --git a/llvm/test/Analysis/DDG/basic-b.ll b/llvm/test/Analysis/DDG/basic-b.ll index adcaf57..66a6a83 100644 --- a/llvm/test/Analysis/DDG/basic-b.ll +++ b/llvm/test/Analysis/DDG/basic-b.ll @@ -30,21 +30,21 @@ ; 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]] @@ -52,7 +52,7 @@ ; 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]*]] @@ -64,7 +64,7 @@ ; 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 --- @@ -74,12 +74,12 @@ ;; 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 @@ -87,14 +87,14 @@ entry: 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 @@ -134,23 +134,23 @@ for.end: ; preds = %test1.for.body, %en ; 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]] @@ -162,17 +162,17 @@ for.end: ; preds = %test1.for.body, %en ; 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 @@ -180,14 +180,14 @@ entry: 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 diff --git a/llvm/test/Analysis/DDG/basic-loopnest.ll b/llvm/test/Analysis/DDG/basic-loopnest.ll index e447208..325428c 100644 --- a/llvm/test/Analysis/DDG/basic-loopnest.ll +++ b/llvm/test/Analysis/DDG/basic-loopnest.ll @@ -58,40 +58,40 @@ ; 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]] @@ -99,7 +99,7 @@ ; 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]*]] @@ -111,7 +111,7 @@ ; 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 --- @@ -154,7 +154,7 @@ ;; 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 @@ -168,19 +168,19 @@ test1.for.cond1.preheader: ; preds = %entry, %for.i 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 @@ -253,27 +253,27 @@ for.end14: ; preds = %for.inc12, %entry ; 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]] @@ -281,14 +281,14 @@ for.end14: ; preds = %for.inc12, %entry ; 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]] @@ -300,7 +300,7 @@ for.end14: ; preds = %for.inc12, %entry ; 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 @@ -340,7 +340,7 @@ for.end14: ; preds = %for.inc12, %entry ;; 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 @@ -354,19 +354,19 @@ test2.for.cond1.preheader: ; preds = %entry, %for.i 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 diff --git a/llvm/test/Analysis/DDG/print-dot-ddg.ll b/llvm/test/Analysis/DDG/print-dot-ddg.ll index 939fde1..51e950d 100644 --- a/llvm/test/Analysis/DDG/print-dot-ddg.ll +++ b/llvm/test/Analysis/DDG/print-dot-ddg.ll @@ -10,7 +10,7 @@ target datalayout = "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512" ; printed properly and that multiple memory dependencies on a single edge ; 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; @@ -24,22 +24,22 @@ target datalayout = "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512" ; CHECK: {{Node0x.*}} -> {{Node0x.*}}[label="[rooted]"] ; CHECK-COUNT-6: {{Node0x.*}} -> {{Node0x.*}}[label="[def-use]"] ; CHECK-NOT: {{Node0x.*}} -> {{Node0x.*}}[label="[def-use]"] -; CHECK: [shape=record,label="{\\n %arrayidx10 = getelementptr inbounds float, float* %B, i64 %indvars.iv.next\n}"]; -; CHECK: [shape=record,label="{\\n %arrayidx = getelementptr inbounds float, float* %A, i64 %indvars.iv\n %0 = load float, float* %arrayidx, align 4\n}"]; +; CHECK: [shape=record,label="{\\n %arrayidx10 = getelementptr inbounds float, ptr %B, i64 %indvars.iv.next\n}"]; +; CHECK: [shape=record,label="{\\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="{\\n--- start of nodes in pi-block ---\n\\n %1 = load float, float* %arrayidx2, align 4\n\n\\n %add = fadd fast float %0, %1\n\n\\n store float %add, float* %arrayidx4, align 4\n\n\\n %2 = load float, float* %arrayidx6, align 4\n %add7 = fadd fast float %2, 1.000000e+00\n\n\\n store float %add7, float* %arrayidx10, align 4\n--- end of nodes in pi-block ---\n}"]; +; CHECK: [shape=record,label="{\\n--- start of nodes in pi-block ---\n\\n %1 = load float, ptr %arrayidx2, align 4\n\n\\n %add = fadd fast float %0, %1\n\n\\n store float %add, ptr %arrayidx4, align 4\n\n\\n %2 = load float, ptr %arrayidx6, align 4\n %add7 = fadd fast float %2, 1.000000e+00\n\n\\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 @@ -50,19 +50,19 @@ for.body.preheader: ; preds = %entry 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 diff --git a/llvm/test/Analysis/DDG/root-node.ll b/llvm/test/Analysis/DDG/root-node.ll index 868fb72..b96d552 100644 --- a/llvm/test/Analysis/DDG/root-node.ll +++ b/llvm/test/Analysis/DDG/root-node.ll @@ -14,14 +14,14 @@ ; 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 @@ -32,10 +32,10 @@ for.body.lr.ph: ; preds = %entry 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 diff --git a/llvm/test/Analysis/MustExecute/infinite_loops.ll b/llvm/test/Analysis/MustExecute/infinite_loops.ll index b8158e1..c9dc609 100644 --- a/llvm/test/Analysis/MustExecute/infinite_loops.ll +++ b/llvm/test/Analysis/MustExecute/infinite_loops.ll @@ -72,7 +72,7 @@ exit: } ; 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:%.*]] @@ -82,7 +82,7 @@ define void @test_impossible_exit_in_untaken_block(i1 %cond, i32 %a, i32 %b, i32 ; 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) @@ -99,7 +99,7 @@ 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: diff --git a/llvm/test/Analysis/MustExecute/loop-header.ll b/llvm/test/Analysis/MustExecute/loop-header.ll index 396877d..80aadff 100644 --- a/llvm/test/Analysis/MustExecute/loop-header.ll +++ b/llvm/test/Analysis/MustExecute/loop-header.ll @@ -1,11 +1,11 @@ ; 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 @@ -14,7 +14,7 @@ entry: 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 @@ -24,11 +24,11 @@ exit: 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: @@ -36,7 +36,7 @@ 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) @@ -50,13 +50,13 @@ exit: ; 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 @@ -69,7 +69,7 @@ loop: 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 @@ -83,13 +83,13 @@ exit: 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: @@ -105,7 +105,7 @@ loop: 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 @@ -121,13 +121,13 @@ exit: ; Since all the instructions in the loop dominate the only exit ; and there's no implicit control flow in the loop, all must execute ; 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) @@ -140,7 +140,7 @@ 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 diff --git a/llvm/test/Analysis/MustExecute/must_be_executed_context.ll b/llvm/test/Analysis/MustExecute/must_be_executed_context.ll index 0327611..f3360f7 100644 --- a/llvm/test/Analysis/MustExecute/must_be_executed_context.ll +++ b/llvm/test/Analysis/MustExecute/must_be_executed_context.ll @@ -386,37 +386,37 @@ declare void @F() nounwind 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 @@ -427,7 +427,7 @@ define i32 @nonnull_exec_ctx_1(i32* %a, i32 %b) { ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %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 @@ -435,7 +435,7 @@ define i32 @nonnull_exec_ctx_1(i32* %a, i32 %b) { ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b ; MBEC-NEXT: [F: nonnull_exec_ctx_1] 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 @@ -443,7 +443,7 @@ define i32 @nonnull_exec_ctx_1(i32* %a, i32 %b) { ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %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 @@ -452,54 +452,54 @@ en: 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 @@ -508,29 +508,29 @@ define i32 @nonnull_exec_ctx_2(i32* %a, i32 %b) nounwind willreturn { ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %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 @@ -539,12 +539,12 @@ en: 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 diff --git a/llvm/test/Analysis/PhiValues/basic.ll b/llvm/test/Analysis/PhiValues/basic.ll index ca01382..fc95927 100644 --- a/llvm/test/Analysis/PhiValues/basic.ll +++ b/llvm/test/Analysis/PhiValues/basic.ll @@ -3,7 +3,7 @@ @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 @@ -21,7 +21,7 @@ end: ; 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 } diff --git a/llvm/test/Analysis/PhiValues/big_phi.ll b/llvm/test/Analysis/PhiValues/big_phi.ll index 6f13098..50ef7dc 100644 --- a/llvm/test/Analysis/PhiValues/big_phi.ll +++ b/llvm/test/Analysis/PhiValues/big_phi.ll @@ -5,15 +5,15 @@ ; 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 @@ -71,8 +71,8 @@ bb13: 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 } diff --git a/llvm/test/Analysis/PhiValues/long_phi_chain.ll b/llvm/test/Analysis/PhiValues/long_phi_chain.ll index 850c4f1..c21835e 100644 --- a/llvm/test/Analysis/PhiValues/long_phi_chain.ll +++ b/llvm/test/Analysis/PhiValues/long_phi_chain.ll @@ -4,14 +4,14 @@ ; 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: @@ -22,8 +22,8 @@ while1.if: 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: @@ -31,8 +31,8 @@ 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: @@ -40,8 +40,8 @@ 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: @@ -49,8 +49,8 @@ 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: @@ -58,14 +58,14 @@ 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: @@ -76,8 +76,8 @@ while3.end: 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: @@ -85,8 +85,8 @@ 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: @@ -94,8 +94,8 @@ 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: @@ -103,8 +103,8 @@ 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: @@ -112,8 +112,8 @@ 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: @@ -121,8 +121,8 @@ 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: @@ -130,13 +130,13 @@ 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 } diff --git a/llvm/test/Analysis/PostDominators/infinite-loop.ll b/llvm/test/Analysis/PostDominators/infinite-loop.ll index 52e78f1..7a52ba9 100644 --- a/llvm/test/Analysis/PostDominators/infinite-loop.ll +++ b/llvm/test/Analysis/PostDominators/infinite-loop.ll @@ -4,7 +4,7 @@ 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 @@ -16,7 +16,7 @@ loop: ; preds = %loop, %if.then br label %loop if.end: ; preds = %entry - store i32 6, i32* @a, align 4 + store i32 6, ptr @a, align 4 ret void } diff --git a/llvm/test/Analysis/PostDominators/infinite-loop2.ll b/llvm/test/Analysis/PostDominators/infinite-loop2.ll index da1073c..fb1de1e 100644 --- a/llvm/test/Analysis/PostDominators/infinite-loop2.ll +++ b/llvm/test/Analysis/PostDominators/infinite-loop2.ll @@ -4,7 +4,7 @@ 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 @@ -13,12 +13,12 @@ if.then: ; preds = %entry 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 } diff --git a/llvm/test/Analysis/PostDominators/infinite-loop3.ll b/llvm/test/Analysis/PostDominators/infinite-loop3.ll index 8a9db81..e0f9054 100644 --- a/llvm/test/Analysis/PostDominators/infinite-loop3.ll +++ b/llvm/test/Analysis/PostDominators/infinite-loop3.ll @@ -4,7 +4,7 @@ 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 @@ -13,12 +13,12 @@ if.then: ; preds = %entry, %loop 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 } diff --git a/llvm/test/Analysis/ScopedNoAliasAA/alias-scope-merging.ll b/llvm/test/Analysis/ScopedNoAliasAA/alias-scope-merging.ll index c5db828..989049a 100644 --- a/llvm/test/Analysis/ScopedNoAliasAA/alias-scope-merging.ll +++ b/llvm/test/Analysis/ScopedNoAliasAA/alias-scope-merging.ll @@ -5,13 +5,13 @@ define i8 @test(i8 %input) { %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 } @@ -20,9 +20,9 @@ define i8 @test(i8 %input) { ; 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"} diff --git a/llvm/test/Analysis/ScopedNoAliasAA/basic-domains.ll b/llvm/test/Analysis/ScopedNoAliasAA/basic-domains.ll index 0802c00..96fceee 100644 --- a/llvm/test/Analysis/ScopedNoAliasAA/basic-domains.ll +++ b/llvm/test/Analysis/ScopedNoAliasAA/basic-domains.ll @@ -2,20 +2,20 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" target 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 } @@ -40,16 +40,16 @@ attributes #0 = { nounwind uwtable } ; 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 diff --git a/llvm/test/Analysis/ScopedNoAliasAA/basic.ll b/llvm/test/Analysis/ScopedNoAliasAA/basic.ll index 0aa0d2d..0a16a11 100644 --- a/llvm/test/Analysis/ScopedNoAliasAA/basic.ll +++ b/llvm/test/Analysis/ScopedNoAliasAA/basic.ll @@ -2,22 +2,22 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" target 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 } diff --git a/llvm/test/Analysis/ScopedNoAliasAA/basic2.ll b/llvm/test/Analysis/ScopedNoAliasAA/basic2.ll index d384d2e..b17f4e1 100644 --- a/llvm/test/Analysis/ScopedNoAliasAA/basic2.ll +++ b/llvm/test/Analysis/ScopedNoAliasAA/basic2.ll @@ -2,31 +2,31 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" target 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 } diff --git a/llvm/test/Analysis/StackSafetyAnalysis/Inputs/ipa-alias.ll b/llvm/test/Analysis/StackSafetyAnalysis/Inputs/ipa-alias.ll index c1736c9..dd365cc 100644 --- a/llvm/test/Analysis/StackSafetyAnalysis/Inputs/ipa-alias.ll +++ b/llvm/test/Analysis/StackSafetyAnalysis/Inputs/ipa-alias.ll @@ -1,21 +1,21 @@ 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" } diff --git a/llvm/test/Analysis/StackSafetyAnalysis/Inputs/ipa.ll b/llvm/test/Analysis/StackSafetyAnalysis/Inputs/ipa.ll index e526a16..01971c9 100644 --- a/llvm/test/Analysis/StackSafetyAnalysis/Inputs/ipa.ll +++ b/llvm/test/Analysis/StackSafetyAnalysis/Inputs/ipa.ll @@ -3,99 +3,95 @@ target triple = "aarch64-unknown-linux" 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: @@ -103,65 +99,65 @@ 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 } diff --git a/llvm/test/Analysis/StackSafetyAnalysis/i386-bug-fix.ll b/llvm/test/Analysis/StackSafetyAnalysis/i386-bug-fix.ll index 5470805..9999cd2 100644 --- a/llvm/test/Analysis/StackSafetyAnalysis/i386-bug-fix.ll +++ b/llvm/test/Analysis/StackSafetyAnalysis/i386-bug-fix.ll @@ -14,11 +14,11 @@ target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f8 target triple = "i386-pc-linux-gnu" ; 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 } diff --git a/llvm/test/Analysis/StackSafetyAnalysis/ipa-alias.ll b/llvm/test/Analysis/StackSafetyAnalysis/ipa-alias.ll index 8a37105..a4846da 100644 --- a/llvm/test/Analysis/StackSafetyAnalysis/ipa-alias.ll +++ b/llvm/test/Analysis/StackSafetyAnalysis/ipa-alias.ll @@ -33,7 +33,7 @@ ; 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 @@ -42,16 +42,16 @@ target triple = "aarch64-unknown-linux" 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 { @@ -66,11 +66,11 @@ 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 } @@ -87,7 +87,7 @@ define void @InterposableAliasCall() #0 { 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 } @@ -102,7 +102,7 @@ define void @AliasCall() #0 { ; CHECK-EMPTY: entry: %x = alloca i8 - call void @AliasWrite1(i8* %x) + call void @AliasWrite1(ptr %x) ret void } @@ -119,9 +119,9 @@ define void @BitcastAliasCall() #0 { ; 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 } @@ -132,5 +132,5 @@ entry: ; 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: diff --git a/llvm/test/Analysis/StackSafetyAnalysis/ipa.ll b/llvm/test/Analysis/StackSafetyAnalysis/ipa.ll index 9d64332..dd6d714 100644 --- a/llvm/test/Analysis/StackSafetyAnalysis/ipa.ll +++ b/llvm/test/Analysis/StackSafetyAnalysis/ipa.ll @@ -83,7 +83,7 @@ ; 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 @@ -95,22 +95,22 @@ target triple = "aarch64-unknown-linux" 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 { @@ -123,8 +123,7 @@ 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 } @@ -139,8 +138,7 @@ define void @f2() #0 { ; 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 } @@ -155,8 +153,7 @@ define void @f3() #0 { ; 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 } @@ -171,9 +168,8 @@ define void @f4() #0 { ; 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 } @@ -188,9 +184,8 @@ define void @f5() #0 { ; 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 } @@ -205,8 +200,7 @@ define void @f6() #0 { ; 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 } @@ -221,8 +215,7 @@ define void @PreemptableCall() #0 { ; 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 } @@ -238,8 +231,7 @@ define void @InterposableCall() #0 { ; 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 } @@ -254,21 +246,20 @@ define void @PrivateCall() #0 { ; 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 } @@ -284,8 +275,7 @@ define void @f7() #0 { ; 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 } @@ -299,10 +289,9 @@ define void @f8left() #0 { ; 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 } @@ -316,10 +305,9 @@ define void @f8right() #0 { ; 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 } @@ -333,10 +321,9 @@ define void @f8oobleft() #0 { ; 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 } @@ -350,10 +337,9 @@ define void @f8oobright() #0 { ; 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 } @@ -367,9 +353,8 @@ define void @TwoArguments() #0 { ; 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 } @@ -383,9 +368,8 @@ define void @TwoArgumentsOOBOne() #0 { ; 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 } @@ -399,10 +383,9 @@ define void @TwoArgumentsOOBOther() #0 { ; 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 } @@ -416,14 +399,13 @@ define void @TwoArgumentsOOBBoth() #0 { ; 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)){{$}} @@ -431,16 +413,15 @@ define i32 @TestRecursiveNoOffset(i32* %p, i32 %size) #0 { ; 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 { @@ -453,7 +434,7 @@ 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 } @@ -468,7 +449,7 @@ define void @TestUpdateArg() #0 { ; CHECK-EMPTY: entry: %x = alloca i8, i64 16, align 4 - %0 = call i8* @WriteAndReturn8(i8* %x) + %0 = call ptr @WriteAndReturn8(ptr %x) ret void } @@ -482,7 +463,7 @@ define void @TestCrossModuleOnce() #0 { ; CHECK-EMPTY: entry: %y = alloca i8, align 4 - call void @Write1SameModule(i8* %y) + call void @Write1SameModule(ptr %y) ret void } @@ -496,7 +477,7 @@ define void @TestCrossModuleTwice() #0 { ; CHECK-EMPTY: entry: %z = alloca i8, align 4 - call void @Write1DiffModule(i8* %z) + call void @Write1DiffModule(ptr %z) ret void } @@ -510,7 +491,7 @@ define void @TestCrossModuleConflict() #0 { ; CHECK-EMPTY: entry: %x = alloca i8, align 4 - call void @Write1Private(i8* %x) + call void @Write1Private(ptr %x) ret void } @@ -526,27 +507,27 @@ define void @TestCrossModuleWeak() #0 { ; 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 } @@ -557,7 +538,7 @@ entry: ; 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{{$}} @@ -565,7 +546,7 @@ entry: ; 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{{$}} @@ -574,8 +555,8 @@ entry: ; 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{{$}} @@ -583,7 +564,7 @@ entry: ; 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{{$}} @@ -591,7 +572,7 @@ entry: ; 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{{$}} @@ -599,7 +580,7 @@ entry: ; 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{{$}} @@ -607,7 +588,7 @@ entry: ; 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{{$}} @@ -648,9 +629,9 @@ entry: ; 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{{$}} @@ -659,7 +640,7 @@ entry: ; 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 diff --git a/llvm/test/Analysis/StackSafetyAnalysis/lifetime.ll b/llvm/test/Analysis/StackSafetyAnalysis/lifetime.ll index 7e3b39f..32d76fb 100644 --- a/llvm/test/Analysis/StackSafetyAnalysis/lifetime.ll +++ b/llvm/test/Analysis/StackSafetyAnalysis/lifetime.ll @@ -11,34 +11,31 @@ entry: ; 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: - 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: - 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: - 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: - 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 @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 @@ -51,17 +48,16 @@ entry: ; CHECK-NEXT: Alive: %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: - 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: - call void @capture32(i32* %y) + call void @capture32(ptr %y) ret void } @@ -73,34 +69,31 @@ entry: %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: - 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: - 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: - 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: - 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 @@ -118,34 +111,31 @@ entry: ; 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: - 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: - 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: - 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: - 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: - 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 @@ -164,18 +154,16 @@ entry: %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: - %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: - 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: @@ -183,25 +171,23 @@ entry: if.then: ; preds = %entry ; CHECK: if.then: ; CHECK-NEXT: Alive: - %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: - 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: - %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: - 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: br label %if.end @@ -209,14 +195,13 @@ if.then3: ; preds = %if.then if.else: ; preds = %if.then ; CHECK: if.else: ; CHECK-NEXT: Alive: - %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: - 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: br label %if.end @@ -224,8 +209,8 @@ if.else: ; preds = %if.then if.end: ; preds = %if.else, %if.then3 ; CHECK: if.end: ; CHECK-NEXT: Alive: - 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: br label %if.end9 @@ -233,29 +218,27 @@ if.end: ; preds = %if.else, %if.then3 if.else4: ; preds = %entry ; CHECK: if.else4: ; CHECK-NEXT: Alive: - - %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: - 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: - 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: - %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: - 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: br label %if.end8 @@ -263,14 +246,13 @@ if.then6: ; preds = %if.else4 if.else7: ; preds = %if.else4 ; CHECK: if.else7: ; CHECK-NEXT: Alive: - %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: - 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: br label %if.end8 @@ -278,8 +260,8 @@ if.else7: ; preds = %if.else4 if.end8: ; preds = %if.else7, %if.then6 ; CHECK: if.end8: ; CHECK-NEXT: Alive: - 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: br label %if.end9 @@ -287,12 +269,12 @@ if.end8: ; preds = %if.else7, %if.then6 if.end9: ; preds = %if.end8, %if.end ; CHECK: if.end9: ; CHECK-NEXT: Alive: - 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: - 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 @@ -305,29 +287,27 @@ 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: - 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: - 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: - 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.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 @@ -335,8 +315,8 @@ bb2: ; preds = %entry bb3: ; preds = %entry ; CHECK: bb3: ; CHECK-NEXT: Alive: - 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 @@ -349,15 +329,13 @@ 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: - 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 @@ -365,13 +343,13 @@ entry: 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: - 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 @@ -389,15 +367,13 @@ 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: - 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 @@ -405,11 +381,11 @@ entry: 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: - call void @capture32(i32* %y) + call void @capture32(ptr %y) ret void bb3: ; preds = %entry @@ -425,27 +401,25 @@ 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: - 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: - 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: - call void @capture32(i32* %y) + call void @capture32(ptr %y) ret void bb3: ; preds = %entry @@ -461,11 +435,9 @@ 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 @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 @@ -473,11 +445,11 @@ entry: 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: - call void @capture32(i32* %y) + call void @capture32(ptr %y) ret void bb3: ; preds = %entry @@ -495,47 +467,43 @@ 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: - %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: - 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: - 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: - 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: - %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: - 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: - 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 @@ -548,24 +516,24 @@ entry: ; 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: - 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: - 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: - call void @capture8(i8* %buf1) - call void @capture8(i8* %buf2) + call void @capture8(ptr %buf1) + call void @capture8(ptr %buf2) ret void } @@ -578,24 +546,22 @@ 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: - %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: - 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: - 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: br label %block2 @@ -603,40 +569,37 @@ entry: block2: ; preds = %entry ; CHECK: block2: ; CHECK-NEXT: Alive: - 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: - 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: - 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: - 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 @@ -648,8 +611,8 @@ entry: ; 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: br label %l2 @@ -658,9 +621,9 @@ l2: ; preds = %l2, %entry ; CHECK: l2: ; MAY-NEXT: Alive: ; 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 @@ -673,8 +636,8 @@ entry: ; 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: br label %l2 @@ -682,20 +645,20 @@ entry: l2: ; preds = %l2, %entry ; CHECK: l2: ; 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: - 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: - 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: - call void @capture8(i8* %x) + call void @capture8(ptr %x) br label %l2 } @@ -714,26 +677,24 @@ entry: 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: - 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: - 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 @@ -758,8 +719,8 @@ entry: 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: br label %if.end @@ -769,12 +730,12 @@ if.then: 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: - 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: br label %if.end @@ -797,12 +758,12 @@ entry: %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: - 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: br label %end @@ -812,7 +773,7 @@ entry: 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 @@ -825,7 +786,7 @@ end: ret void } -define void @non_alloca(i8* %p) { +define void @non_alloca(ptr %p) { ; CHECK-LABEL: define void @non_alloca entry: ; CHECK: entry: @@ -834,18 +795,18 @@ 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: ; 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: ; 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: ; MUST-NEXT: Alive: <> @@ -860,20 +821,20 @@ entry: ; 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: ; 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: ; 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: ; MUST-NEXT: Alive: <> @@ -887,15 +848,15 @@ entry: ; MAY-NEXT: Alive: ; 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: ; 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: ; MUST-NEXT: Alive: <> @@ -909,15 +870,14 @@ entry: ; MAY-NEXT: Alive: ; 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: ; 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: ; MUST-NEXT: Alive: <> @@ -930,20 +890,20 @@ entry: ; 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: - 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: - 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 @@ -965,8 +925,8 @@ if.then: ; CHECK: if.then: ; MAY-NEXT: Alive: ; 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: ; MUST-NEXT: Alive: <> @@ -978,12 +938,12 @@ if.then: 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: - 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: br label %if.then @@ -1006,8 +966,8 @@ entry: %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: br i1 %a, label %if.then, label %if.else @@ -1018,8 +978,8 @@ if.then: ; CHECK: if.then: ; MAY-NEXT: Alive: ; 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: ; MUST-NEXT: Alive: @@ -1031,12 +991,12 @@ if.then: if.else: ; CHECK: if.else: ; CHECK-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) ; 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: <> br label %if.then @@ -1059,8 +1019,8 @@ entry: %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: br i1 %a, label %if.then, label %if.end @@ -1071,8 +1031,8 @@ if.then: ; CHECK: if.then: ; MAY-NEXT: Alive: ; 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) ; CHECK-NEXT: Alive: br i1 %a, label %if.then, label %if.end @@ -1087,11 +1047,9 @@ 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) diff --git a/llvm/test/Analysis/StackSafetyAnalysis/local.ll b/llvm/test/Analysis/StackSafetyAnalysis/local.ll index 6ea15f8..437c7f1 100644 --- a/llvm/test/Analysis/StackSafetyAnalysis/local.ll +++ b/llvm/test/Analysis/StackSafetyAnalysis/local.ll @@ -4,15 +4,15 @@ 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() { @@ -24,8 +24,7 @@ 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 } @@ -35,12 +34,11 @@ define void @StoreInBounds() { ; 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 } @@ -50,11 +48,10 @@ define void @StoreInBoundsCond(i64 %i) { ; 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 @@ -63,8 +60,8 @@ c1.true: 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: @@ -77,17 +74,16 @@ define void @StoreInBoundsMinMax(i64 %i) { ; 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 } @@ -97,11 +93,11 @@ define void @StoreInBounds2() { ; 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 } @@ -111,13 +107,12 @@ define void @StoreInBounds3() { ; 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 } @@ -131,10 +126,10 @@ define void @StoreInBounds4() { ; 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 } @@ -145,46 +140,45 @@ define void @StoreInBounds6() { ; 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 } @@ -197,10 +191,8 @@ define void @StoreOutOfBounds() { ; 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 } @@ -213,7 +205,6 @@ define void @StoreOutOfBoundsCond(i64 %i) { ; 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 @@ -222,8 +213,8 @@ c1.true: 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: @@ -239,13 +230,12 @@ define void @StoreOutOfBoundsCond2(i64 %i) { ; 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: @@ -262,11 +252,9 @@ define void @StoreOutOfBounds2() { ; 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 } @@ -277,12 +265,11 @@ define void @LoadInBounds() { ; 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 } @@ -295,15 +282,13 @@ define void @LoadOutOfBounds() { ; 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: @@ -312,12 +297,11 @@ define i8* @Ret() { ; 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{{$}} @@ -329,15 +313,14 @@ define void @DirectCall() { ; 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{{$}} @@ -347,8 +330,7 @@ define void @IndirectCall(void (i8*)* %p) { ; 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 } @@ -359,14 +341,13 @@ define void @NonConstantOffset(i1 zeroext %z) { ; 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 } @@ -379,8 +360,8 @@ define void @NegativeOffset() { ; 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 } @@ -393,8 +374,8 @@ define void @PossiblyNegativeOffset(i16 %z) { ; 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 } @@ -407,10 +388,9 @@ define void @NonConstantOffsetOOB(i1 zeroext %z) { ; 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 } @@ -420,14 +400,12 @@ define void @ArrayAlloca() { ; 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 } @@ -440,10 +418,8 @@ define void @ArrayAllocaOOB() { ; 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 } @@ -469,7 +445,7 @@ define void @DynamicAlloca(i64 %size) { ; 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 } @@ -485,7 +461,7 @@ define void @DynamicAllocaFiniteSizeRange(i1 zeroext %z) { 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 } @@ -495,21 +471,20 @@ define signext i8 @SimpleLoop() { ; 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: @@ -526,18 +501,17 @@ define signext i8 @SimpleLoopOOB() { ; 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: @@ -553,12 +527,11 @@ define dso_local void @SizeCheck(i32 %sz) { ; 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: @@ -567,7 +540,7 @@ 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(* %p, * %unused, %v) { +define void @Scalable(ptr %p, ptr %unused, %v) { ; CHECK-LABEL: @Scalable dso_preemptable{{$}} ; CHECK-NEXT: args uses: ; CHECK-NEXT: p[]: full-set @@ -575,34 +548,33 @@ define void @Scalable(* %p, * %unused, %v, * %p, align 4 +; GLOBAL-NEXT: store %v, ptr %p, align 4 ; CHECK-EMPTY: entry: %x = alloca , align 4 - %x1 = bitcast * %x to i8* - store i8 0, i8* %x1, align 1 - store %v, * %p, align 4 + store i8 0, ptr %x, align 1 + store %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 } @@ -615,11 +587,11 @@ define void @OperandBundle() { ; 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: @@ -636,21 +608,20 @@ define void @TestByVal() { ; 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{{$}} @@ -661,23 +632,21 @@ define void @TestByValArray() { ; 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 } @@ -691,28 +660,28 @@ define void @Overflow() { ; 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: @@ -733,13 +702,13 @@ entry: %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 } @@ -752,22 +721,22 @@ define void @LifeOK() { ; 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 } @@ -786,17 +755,17 @@ entry: %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 } @@ -808,13 +777,12 @@ define void @TwoAllocasOK() { ; 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 } @@ -828,9 +796,8 @@ define void @TwoAllocasOOBDest() { ; 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 } @@ -844,9 +811,8 @@ define void @TwoAllocasOOBSource() { ; 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 } @@ -860,9 +826,8 @@ define void @TwoAllocasOOBBoth() { ; 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 } @@ -872,13 +837,12 @@ define void @MixedAccesses() { ; 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 } @@ -888,30 +852,28 @@ define void @MixedAccesses2() { ; 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 } @@ -922,52 +884,51 @@ define void @MixedAccesses4() { ; 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. ; @@ -980,13 +941,12 @@ define void @MixedAccesses7(i1 %cond, i8* %arg) { ; 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) @@ -994,12 +954,11 @@ define void @NoStackAccess(i8* %arg1, i8* %arg2) { ; 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 } @@ -1009,18 +968,17 @@ define void @DoubleLifetime() { ; 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 } @@ -1030,18 +988,17 @@ define void @DoubleLifetime2() { ; 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 } @@ -1051,18 +1008,17 @@ define void @DoubleLifetime3() { ; 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 } @@ -1072,17 +1028,16 @@ define void @DoubleLifetime4() { ; 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) diff --git a/llvm/test/Analysis/StackSafetyAnalysis/memintrin.ll b/llvm/test/Analysis/StackSafetyAnalysis/memintrin.ll index 9e1c49c..791fb35 100644 --- a/llvm/test/Analysis/StackSafetyAnalysis/memintrin.ll +++ b/llvm/test/Analysis/StackSafetyAnalysis/memintrin.ll @@ -4,10 +4,10 @@ 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{{$}} @@ -15,12 +15,11 @@ define void @MemsetInBounds() { ; 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 } @@ -31,12 +30,11 @@ define void @VolatileMemsetInBounds() { ; 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 } @@ -49,8 +47,7 @@ define void @MemsetOutOfBounds() { ; 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 } @@ -63,8 +60,7 @@ define void @MemsetNonConst(i32 %size) { ; 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 } @@ -79,9 +75,8 @@ define void @MemsetNonConstInBounds(i1 zeroext %z) { ; 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 } @@ -96,11 +91,10 @@ define void @MemsetNonConstSize() { 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 } @@ -111,14 +105,12 @@ define void @MemcpyInBounds() { ; 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 } @@ -133,9 +125,7 @@ define void @MemcpySrcOutOfBounds() { 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 } @@ -150,9 +140,7 @@ define void @MemcpyDstOutOfBounds() { 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 } @@ -167,9 +155,7 @@ define void @MemcpyBothOutOfBounds() { 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 } @@ -179,13 +165,12 @@ define void @MemcpySelfInBounds() { ; 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 } @@ -198,9 +183,8 @@ define void @MemcpySelfSrcOutOfBounds() { ; 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 } @@ -213,9 +197,8 @@ define void @MemcpySelfDstOutOfBounds() { ; 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 } @@ -228,9 +211,8 @@ define void @MemmoveSelfBothOutOfBounds() { ; 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 } @@ -241,14 +223,13 @@ define void @MemsetInBoundsCast() { ; 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 } @@ -260,15 +241,13 @@ define void @MemcpyInBoundsCast2(i8 %zint8) { ; 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 } -- 2.7.4