From 563cf93776e7100aabe6d91afdcd7e7405ee7338 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 22 Jun 2022 12:24:43 +0200 Subject: [PATCH] [ADCE] Update tests to use opaque pointers (NFC) Update performed using: https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34 This time without any manual fixup. --- .../ADCE/2002-05-23-ZeroArgPHITest.ll | 20 +++--- llvm/test/Transforms/ADCE/2002-05-28-Crash.ll | 16 ++--- .../ADCE/2002-07-17-AssertionFailure.ll | 7 +- .../ADCE/2002-07-17-PHIAssertion.ll | 10 +-- .../ADCE/2003-01-22-PredecessorProblem.ll | 3 +- .../ADCE/2003-04-25-PHIPostDominateProblem.ll | 2 +- .../Transforms/ADCE/2003-06-11-InvalidCFG.ll | 10 +-- .../ADCE/2003-06-24-BadSuccessor.ll | 12 ++-- .../ADCE/2003-06-24-BasicFunctionality.ll | 12 ++-- .../ADCE/2003-09-10-UnwindInstFail.ll | 8 +-- .../ADCE/2005-02-17-PHI-Invoke-Crash.ll | 10 +-- llvm/test/Transforms/ADCE/2016-09-06.ll | 24 +++---- llvm/test/Transforms/ADCE/basictest1.ll | 71 +++++++++---------- llvm/test/Transforms/ADCE/basictest2.ll | 71 +++++++++---------- llvm/test/Transforms/ADCE/dce_pure_call.ll | 4 +- llvm/test/Transforms/ADCE/dce_pure_invoke.ll | 8 +-- .../delete-profiling-calls-to-constant.ll | 6 +- .../Transforms/ADCE/domtree-DoubleDeletion.ll | 6 +- 18 files changed, 148 insertions(+), 152 deletions(-) diff --git a/llvm/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll b/llvm/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll index 1de9d94ff755..4a20cc051900 100644 --- a/llvm/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll +++ b/llvm/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll @@ -7,25 +7,25 @@ ; RUN: opt < %s -S -passes=adce | grep bb1 ; RUN: opt < %s -S -passes=adce -adce-remove-loops | FileCheck %s - %node_t = type { double*, %node_t*, %node_t**, double**, double*, i32, i32 } + %node_t = type { ptr, ptr, ptr, ptr, ptr, i32, i32 } -define void @localize_local(%node_t* %nodelist) { +define void @localize_local(ptr %nodelist) { bb0: - %nodelist.upgrd.1 = alloca %node_t* ; <%node_t**> [#uses=2] - store %node_t* %nodelist, %node_t** %nodelist.upgrd.1 + %nodelist.upgrd.1 = alloca ptr ; [#uses=2] + store ptr %nodelist, ptr %nodelist.upgrd.1 br label %bb1 bb1: ; preds = %bb0 - %reg107 = load %node_t*, %node_t** %nodelist.upgrd.1 ; <%node_t*> [#uses=2] - %cond211 = icmp eq %node_t* %reg107, null ; [#uses=1] + %reg107 = load ptr, ptr %nodelist.upgrd.1 ; [#uses=2] + %cond211 = icmp eq ptr %reg107, null ; [#uses=1] ; CHECK: br label %bb3 br i1 %cond211, label %bb3, label %bb2 bb2: ; preds = %bb2, %bb1 - %reg109 = phi %node_t* [ %reg110, %bb2 ], [ %reg107, %bb1 ] ; <%node_t*> [#uses=1] - %reg212 = getelementptr %node_t, %node_t* %reg109, i64 0, i32 1 ; <%node_t**> [#uses=1] - %reg110 = load %node_t*, %node_t** %reg212 ; <%node_t*> [#uses=2] - %cond213 = icmp ne %node_t* %reg110, null ; [#uses=1] + %reg109 = phi ptr [ %reg110, %bb2 ], [ %reg107, %bb1 ] ; [#uses=1] + %reg212 = getelementptr %node_t, ptr %reg109, i64 0, i32 1 ; [#uses=1] + %reg110 = load ptr, ptr %reg212 ; [#uses=2] + %cond213 = icmp ne ptr %reg110, null ; [#uses=1] ; CHECK: br label %bb3 br i1 %cond213, label %bb2, label %bb3 diff --git a/llvm/test/Transforms/ADCE/2002-05-28-Crash.ll b/llvm/test/Transforms/ADCE/2002-05-28-Crash.ll index 90825a1b61b6..fd011254b5d9 100644 --- a/llvm/test/Transforms/ADCE/2002-05-28-Crash.ll +++ b/llvm/test/Transforms/ADCE/2002-05-28-Crash.ll @@ -14,10 +14,10 @@ ; RUN: opt < %s -passes=adce ; RUN: opt < %s -passes=adce -adce-remove-loops -S | FileCheck %s -define i32 @rx_bitset_empty(i32 %size, i32* %set) { +define i32 @rx_bitset_empty(i32 %size, ptr %set) { bb1: - %reg110 = load i32, i32* %set ; [#uses=2] - store i32 1, i32* %set + %reg110 = load i32, ptr %set ; [#uses=2] + store i32 1, ptr %set %cast112 = sext i32 %size to i64 ; [#uses=1] %reg113 = add i64 %cast112, 31 ; [#uses=1] %reg114 = lshr i64 %reg113, 5 ; [#uses=2] @@ -26,8 +26,8 @@ bb1: %reg114-idxcast = trunc i64 %reg114 to i32 ; [#uses=1] %reg114-idxcast-offset = add i32 %reg114-idxcast, 1073741823 ; [#uses=1] %reg114-idxcast-offset.upgrd.1 = zext i32 %reg114-idxcast-offset to i64 ; [#uses=1] - %reg124 = getelementptr i32, i32* %set, i64 %reg114-idxcast-offset.upgrd.1 ; [#uses=1] - %reg125 = load i32, i32* %reg124 ; [#uses=1] + %reg124 = getelementptr i32, ptr %set, i64 %reg114-idxcast-offset.upgrd.1 ; [#uses=1] + %reg125 = load i32, ptr %reg124 ; [#uses=1] %cond232 = icmp ne i32 %reg125, 0 ; [#uses=1] ; CHECK: br label %bb3 br i1 %cond232, label %bb3, label %bb2 @@ -40,13 +40,13 @@ bb2: ; preds = %bb2, %bb1 %reg130-idxcast = bitcast i32 %reg130 to i32 ; [#uses=1] %reg130-idxcast-offset = add i32 %reg130-idxcast, 1073741823 ; [#uses=1] %reg130-idxcast-offset.upgrd.2 = zext i32 %reg130-idxcast-offset to i64 ; [#uses=1] - %reg118 = getelementptr i32, i32* %set, i64 %reg130-idxcast-offset.upgrd.2 ; [#uses=1] - %reg119 = load i32, i32* %reg118 ; [#uses=1] + %reg118 = getelementptr i32, ptr %set, i64 %reg130-idxcast-offset.upgrd.2 ; [#uses=1] + %reg119 = load i32, ptr %reg118 ; [#uses=1] %cond233 = icmp eq i32 %reg119, 0 ; [#uses=1] br i1 %cond233, label %bb2, label %bb3 bb3: ; preds = %bb2, %bb1 - store i32 %reg110, i32* %set + store i32 %reg110, ptr %set %cast126 = zext i32 %reg110 to i64 ; [#uses=1] %reg127 = add i64 %cast126, -1 ; [#uses=1] %reg128 = lshr i64 %reg127, 63 ; [#uses=1] diff --git a/llvm/test/Transforms/ADCE/2002-07-17-AssertionFailure.ll b/llvm/test/Transforms/ADCE/2002-07-17-AssertionFailure.ll index 2fe8aa857db9..ac3490f0fde5 100644 --- a/llvm/test/Transforms/ADCE/2002-07-17-AssertionFailure.ll +++ b/llvm/test/Transforms/ADCE/2002-07-17-AssertionFailure.ll @@ -5,10 +5,9 @@ ; ; RUN: opt < %s -passes=adce -S | FileCheck %s -define void @foo(i8* %reg5481) { - %cast611 = bitcast i8* %reg5481 to i8** ; [#uses=1] - %reg162 = load i8*, i8** %cast611 ; [#uses=1] +define void @foo(ptr %reg5481) { + %reg162 = load ptr, ptr %reg5481 ; [#uses=1] ; CHECK-NOT: ptrtoint - ptrtoint i8* %reg162 to i32 ; :1 [#uses=0] + ptrtoint ptr %reg162 to i32 ; :1 [#uses=0] ret void } diff --git a/llvm/test/Transforms/ADCE/2002-07-17-PHIAssertion.ll b/llvm/test/Transforms/ADCE/2002-07-17-PHIAssertion.ll index 143c1994478f..b01eb7c56ec6 100644 --- a/llvm/test/Transforms/ADCE/2002-07-17-PHIAssertion.ll +++ b/llvm/test/Transforms/ADCE/2002-07-17-PHIAssertion.ll @@ -2,8 +2,8 @@ ; ; RUN: opt < %s -passes=adce | FileCheck %s -@bk = external global i32 ; [#uses=2] -@hufts = external global i32 ; [#uses=1] +@bk = external global i32 ; [#uses=2] +@hufts = external global i32 ; [#uses=1] define i32 @inflate() { bb0: @@ -19,7 +19,7 @@ bb3: ; preds = %bb2 ; CHECK-NOT: bb4: ; CHECK-NOT: bb5: bb4: ; preds = %bb2 - %reg117 = load i32, i32* @hufts ; [#uses=2] + %reg117 = load i32, ptr @hufts ; [#uses=2] %cond241 = icmp ule i32 %reg117, %reg128 ; [#uses=1] br i1 %cond241, label %bb6, label %bb5 @@ -31,12 +31,12 @@ bb6: ; preds = %bb5, %bb4 br i1 false, label %bb2, label %bb7 bb7: ; preds = %bb6 - %reg126 = load i32, i32* @bk ; [#uses=1] + %reg126 = load i32, ptr @bk ; [#uses=1] %cond247 = icmp ule i32 %reg126, 7 ; [#uses=1] br i1 %cond247, label %bb9, label %bb8 bb8: ; preds = %bb8, %bb7 - %reg119 = load i32, i32* @bk ; [#uses=1] + %reg119 = load i32, ptr @bk ; [#uses=1] %cond256 = icmp ugt i32 %reg119, 7 ; [#uses=1] br i1 %cond256, label %bb8, label %bb9 diff --git a/llvm/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll b/llvm/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll index 50a796f93764..dcf4af6a30f0 100644 --- a/llvm/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll +++ b/llvm/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll @@ -7,12 +7,11 @@ define void @conjunction_prune() { br label %bb19 bb19: ; preds = %bb23, %bb22, %0 - %reg205 = phi i8* [ null, %bb22 ], [ null, %bb23 ], [ null, %0 ] ; [#uses=1] + %reg205 = phi ptr [ null, %bb22 ], [ null, %bb23 ], [ null, %0 ] ; [#uses=1] ; CHECK: br label %bb22 br i1 false, label %bb21, label %bb22 bb21: ; preds = %bb19 - %cast455 = bitcast i8* %reg205 to i8** ; [#uses=0] ; CHECK: br label %bb22 br label %bb22 diff --git a/llvm/test/Transforms/ADCE/2003-04-25-PHIPostDominateProblem.ll b/llvm/test/Transforms/ADCE/2003-04-25-PHIPostDominateProblem.ll index 151685b12dc0..de72d1b845df 100644 --- a/llvm/test/Transforms/ADCE/2003-04-25-PHIPostDominateProblem.ll +++ b/llvm/test/Transforms/ADCE/2003-04-25-PHIPostDominateProblem.ll @@ -28,7 +28,7 @@ else: ; preds = %no_exit endif: ; preds = %else, %then %k.0 = phi i32 [ %dec, %else ], [ 0, %then ] ; [#uses=1] - store i32 2, i32* null + store i32 2, ptr null br label %loopentry return: ; preds = %loopentry diff --git a/llvm/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll b/llvm/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll index 97121f11478f..049dc6079e47 100644 --- a/llvm/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll +++ b/llvm/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll @@ -1,11 +1,11 @@ ; RUN: opt < %s -passes=adce -disable-output ; RUN: opt < %s -passes=adce -adce-remove-loops -disable-output -@G = external global i32* ; [#uses=1] +@G = external global ptr ; [#uses=1] -declare void @Fn(i32*) +declare void @Fn(ptr) -define i32 @main(i32 %argc.1, i8** %argv.1) { +define i32 @main(i32 %argc.1, ptr %argv.1) { entry: br label %endif.42 @@ -13,11 +13,11 @@ endif.42: ; preds = %shortcirc_done.12, %then.66, %endif.42, %entr br i1 false, label %endif.65, label %endif.42 then.66: ; preds = %shortcirc_done.12 - call void @Fn( i32* %tmp.2846 ) + call void @Fn( ptr %tmp.2846 ) br label %endif.42 endif.65: ; preds = %endif.42 - %tmp.2846 = load i32*, i32** @G ; [#uses=1] + %tmp.2846 = load ptr, ptr @G ; [#uses=1] br i1 false, label %shortcirc_next.12, label %shortcirc_done.12 shortcirc_next.12: ; preds = %endif.65 diff --git a/llvm/test/Transforms/ADCE/2003-06-24-BadSuccessor.ll b/llvm/test/Transforms/ADCE/2003-06-24-BadSuccessor.ll index f6cdab96e1fd..acdd265157ee 100644 --- a/llvm/test/Transforms/ADCE/2003-06-24-BadSuccessor.ll +++ b/llvm/test/Transforms/ADCE/2003-06-24-BadSuccessor.ll @@ -28,7 +28,7 @@ endif.14: ; preds = %loopentry.0 br i1 false, label %loopentry.1, label %loopentry.0 loopentry.1: ; preds = %then.53, %endif.14 - %SubArrays.10 = phi i32* [ %SubArrays.8, %then.53 ], [ null, %endif.14 ] ; [#uses=3] + %SubArrays.10 = phi ptr [ %SubArrays.8, %then.53 ], [ null, %endif.14 ] ; [#uses=3] br i1 false, label %no_exit.1, label %loopentry.0 no_exit.1: ; preds = %loopentry.1 @@ -51,9 +51,9 @@ shortcirc_next.4: ; preds = %then.44 br i1 false, label %no_exit.2, label %loopexit.2 no_exit.2: ; preds = %shortcirc_next.4 - %tmp.897 = getelementptr i32, i32* %SubArrays.10, i64 0 ; [#uses=1] - %tmp.899 = load i32, i32* %tmp.897 ; [#uses=1] - store i32 %tmp.899, i32* null + %tmp.897 = getelementptr i32, ptr %SubArrays.10, i64 0 ; [#uses=1] + %tmp.899 = load i32, ptr %tmp.897 ; [#uses=1] + store i32 %tmp.899, ptr null ret i32 0 loopexit.2: ; preds = %shortcirc_next.4 @@ -81,8 +81,8 @@ shortcirc_next.8: ; preds = %shortcirc_next.7 ret i32 0 then.53: ; preds = %shortcirc_next.7, %label.17 - %SubArrays.8 = phi i32* [ %SubArrays.10, %shortcirc_next.7 ], [ %SubArrays.10, %label.17 ] ; [#uses=1] - %tmp.1023 = load i32, i32* null ; [#uses=1] + %SubArrays.8 = phi ptr [ %SubArrays.10, %shortcirc_next.7 ], [ %SubArrays.10, %label.17 ] ; [#uses=1] + %tmp.1023 = load i32, ptr null ; [#uses=1] switch i32 %tmp.1023, label %loopentry.1 [ ] diff --git a/llvm/test/Transforms/ADCE/2003-06-24-BasicFunctionality.ll b/llvm/test/Transforms/ADCE/2003-06-24-BasicFunctionality.ll index 7de1351007c5..55750036ff8b 100644 --- a/llvm/test/Transforms/ADCE/2003-06-24-BasicFunctionality.ll +++ b/llvm/test/Transforms/ADCE/2003-06-24-BasicFunctionality.ll @@ -1,22 +1,22 @@ ; RUN: opt < %s -passes=adce -S | FileCheck %s ; RUN: opt < %s -passes=adce -adce-remove-loops -S | FileCheck %s -define void @dead_test8(i32* %data.1, i32 %idx.1) { +define void @dead_test8(ptr %data.1, i32 %idx.1) { entry: - %tmp.1 = load i32, i32* %data.1 ; [#uses=2] + %tmp.1 = load i32, ptr %data.1 ; [#uses=2] %tmp.41 = icmp sgt i32 %tmp.1, 0 ; [#uses=1] br i1 %tmp.41, label %no_exit.preheader, label %return no_exit.preheader: ; preds = %entry - %tmp.11 = getelementptr i32, i32* %data.1, i64 1 ; [#uses=1] + %tmp.11 = getelementptr i32, ptr %data.1, i64 1 ; [#uses=1] %tmp.22-idxcast = sext i32 %idx.1 to i64 ; [#uses=1] - %tmp.28 = getelementptr i32, i32* %data.1, i64 %tmp.22-idxcast ; [#uses=1] + %tmp.28 = getelementptr i32, ptr %data.1, i64 %tmp.22-idxcast ; [#uses=1] br label %no_exit no_exit: ; preds = %endif, %no_exit.preheader %k.1 = phi i32 [ %k.0, %endif ], [ 0, %no_exit.preheader ] ; [#uses=3] %i.0 = phi i32 [ %inc.1, %endif ], [ 0, %no_exit.preheader ] ; [#uses=1] - %tmp.12 = load i32, i32* %tmp.11 ; [#uses=1] + %tmp.12 = load i32, ptr %tmp.11 ; [#uses=1] %tmp.14 = sub i32 0, %tmp.12 ; [#uses=1] ; CHECK-NOT: %tmp.161 %tmp.161 = icmp ne i32 %k.1, %tmp.14 ; [#uses=1] @@ -33,7 +33,7 @@ else: ; preds = %no_exit endif: ; preds = %else, %then %k.0 = phi i32 [ %dec, %else ], [ %inc.0, %then ] ; [#uses=1] - store i32 2, i32* %tmp.28 + store i32 2, ptr %tmp.28 %inc.1 = add i32 %i.0, 1 ; [#uses=2] %tmp.4 = icmp slt i32 %inc.1, %tmp.1 ; [#uses=1] br i1 %tmp.4, label %no_exit, label %return diff --git a/llvm/test/Transforms/ADCE/2003-09-10-UnwindInstFail.ll b/llvm/test/Transforms/ADCE/2003-09-10-UnwindInstFail.ll index 4a2a181d3414..9083428d3028 100644 --- a/llvm/test/Transforms/ADCE/2003-09-10-UnwindInstFail.ll +++ b/llvm/test/Transforms/ADCE/2003-09-10-UnwindInstFail.ll @@ -1,16 +1,16 @@ ; RUN: opt < %s -passes=adce -disable-output -define void @test() personality i32 (...)* @__gxx_personality_v0 { +define void @test() personality ptr @__gxx_personality_v0 { br i1 false, label %then, label %endif then: ; preds = %0 - invoke void null( i8* null ) + invoke void null( ptr null ) to label %invoke_cont unwind label %invoke_catch invoke_catch: ; preds = %then - %exn = landingpad {i8*, i32} + %exn = landingpad {ptr, i32} cleanup - resume { i8*, i32 } %exn + resume { ptr, i32 } %exn invoke_cont: ; preds = %then ret void diff --git a/llvm/test/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll b/llvm/test/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll index 8db0b44aa1c9..db544e6d9e4a 100644 --- a/llvm/test/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll +++ b/llvm/test/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll @@ -6,7 +6,7 @@ declare void @_ZN10QByteArray6resizeEi() declare void @q_atomic_decrement() -define void @_ZNK10QByteArray13leftJustifiedEicb() personality i32 (...)* @__gxx_personality_v0 { +define void @_ZNK10QByteArray13leftJustifiedEicb() personality ptr @__gxx_personality_v0 { entry: invoke void @strlen( ) to label %tmp.3.i.noexc unwind label %invoke_catch.0 @@ -15,7 +15,7 @@ tmp.3.i.noexc: ; preds = %entry br i1 false, label %then.0, label %else.0 invoke_catch.0: ; preds = %entry - %exn.0 = landingpad {i8*, i32} + %exn.0 = landingpad {ptr, i32} cleanup invoke void @q_atomic_decrement( ) to label %tmp.1.i.i183.noexc unwind label %terminate @@ -28,7 +28,7 @@ then.0: ; preds = %tmp.3.i.noexc to label %invoke_cont.1 unwind label %invoke_catch.1 invoke_catch.1: ; preds = %then.0 - %exn.1 = landingpad {i8*, i32} + %exn.1 = landingpad {ptr, i32} cleanup invoke void @q_atomic_decrement( ) to label %tmp.1.i.i162.noexc unwind label %terminate @@ -43,8 +43,8 @@ else.0: ; preds = %tmp.3.i.noexc ret void terminate: ; preds = %invoke_catch.1, %invoke_catch.0 - %dbg.0.1 = phi { }* [ null, %invoke_catch.1 ], [ null, %invoke_catch.0 ] ; <{ }*> [#uses=0] - %exn = landingpad {i8*, i32} + %dbg.0.1 = phi ptr [ null, %invoke_catch.1 ], [ null, %invoke_catch.0 ] ; [#uses=0] + %exn = landingpad {ptr, i32} cleanup unreachable } diff --git a/llvm/test/Transforms/ADCE/2016-09-06.ll b/llvm/test/Transforms/ADCE/2016-09-06.ll index 9c69784f6204..fde6ec3096ae 100644 --- a/llvm/test/Transforms/ADCE/2016-09-06.ll +++ b/llvm/test/Transforms/ADCE/2016-09-06.ll @@ -11,21 +11,21 @@ define i32 @foo(i32, i32, i32) #0 { %6 = alloca i32, align 4 %7 = alloca i32, align 4 %8 = alloca i32, align 4 - store i32 %0, i32* %4, align 4 - store i32 %1, i32* %5, align 4 - store i32 %2, i32* %6, align 4 - store i32 0, i32* %7, align 4 - %9 = load i32, i32* %5, align 4 + store i32 %0, ptr %4, align 4 + store i32 %1, ptr %5, align 4 + store i32 %2, ptr %6, align 4 + store i32 0, ptr %7, align 4 + %9 = load i32, ptr %5, align 4 %I10 = icmp ne i32 %9, 0 br i1 %I10, label %B11, label %B21 B11: - store i32 0, i32* %8, align 4 + store i32 0, ptr %8, align 4 br label %B12 B12: - %I13 = load i32, i32* %8, align 4 - %I14 = load i32, i32* %6, align 4 + %I13 = load i32, ptr %8, align 4 + %I14 = load i32, ptr %6, align 4 %I15 = icmp slt i32 %I13, %I14 ; CHECK: br label %B20 br i1 %I15, label %B16, label %B20 @@ -34,17 +34,17 @@ B16: br label %B17 B17: - %I18 = load i32, i32* %8, align 4 + %I18 = load i32, ptr %8, align 4 %I19 = add nsw i32 %I18, 1 - store i32 %I19, i32* %8, align 4 + store i32 %I19, ptr %8, align 4 br label %B12 B20: - store i32 1, i32* %7, align 4 + store i32 1, ptr %7, align 4 br label %B21 B21: - %I22 = load i32, i32* %7, align 4 + %I22 = load i32, ptr %7, align 4 ret i32 %I22 } diff --git a/llvm/test/Transforms/ADCE/basictest1.ll b/llvm/test/Transforms/ADCE/basictest1.ll index 999af43b76e7..5e4b9678a506 100644 --- a/llvm/test/Transforms/ADCE/basictest1.ll +++ b/llvm/test/Transforms/ADCE/basictest1.ll @@ -1,36 +1,36 @@ ; RUN: opt < %s -passes=adce -S | FileCheck %s ; RUN: opt < %s -passes=adce -adce-remove-loops -S | FileCheck %s -%FILE = type { i32, i8*, i8*, i8, i8, i32, i32, i32 } - %spec_fd_t = type { i32, i32, i32, i8* } -@__iob = external global [20 x %FILE] ; <[20 x %FILE]*> [#uses=1] -@dbglvl = global i32 4 ; [#uses=3] -@spec_fd = external global [3 x %spec_fd_t] ; <[3 x %spec_fd_t]*> [#uses=4] -@.LC9 = internal global [34 x i8] c"spec_read: fd=%d, > MAX_SPEC_FD!\0A\00" ; <[34 x i8]*> [#uses=1] -@.LC10 = internal global [4 x i8] c"EOF\00" ; <[4 x i8]*> [#uses=1] -@.LC11 = internal global [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1] -@.LC12 = internal global [17 x i8] c"spec_getc: %d = \00" ; <[17 x i8]*> [#uses=1] +%FILE = type { i32, ptr, ptr, i8, i8, i32, i32, i32 } + %spec_fd_t = type { i32, i32, i32, ptr } +@__iob = external global [20 x %FILE] ; [#uses=1] +@dbglvl = global i32 4 ; [#uses=3] +@spec_fd = external global [3 x %spec_fd_t] ; [#uses=4] +@.LC9 = internal global [34 x i8] c"spec_read: fd=%d, > MAX_SPEC_FD!\0A\00" ; [#uses=1] +@.LC10 = internal global [4 x i8] c"EOF\00" ; [#uses=1] +@.LC11 = internal global [4 x i8] c"%d\0A\00" ; [#uses=1] +@.LC12 = internal global [17 x i8] c"spec_getc: %d = \00" ; [#uses=1] -declare i32 @fprintf(%FILE*, i8*, ...) +declare i32 @fprintf(ptr, ptr, ...) declare void @exit(i32) -declare i32 @remove(i8*) +declare i32 @remove(ptr) -declare i32 @fputc(i32, %FILE*) +declare i32 @fputc(i32, ptr) -declare i32 @fwrite(i8*, i32, i32, %FILE*) +declare i32 @fwrite(ptr, i32, i32, ptr) -declare void @perror(i8*) +declare void @perror(ptr) define i32 @spec_getc(i32 %fd) { - %reg109 = load i32, i32* @dbglvl ; [#uses=1] + %reg109 = load i32, ptr @dbglvl ; [#uses=1] %cond266 = icmp sle i32 %reg109, 4 ; [#uses=1] ; CHECKL br label %bb3 br i1 %cond266, label %bb3, label %bb2 bb2: ; preds = %0 - %cast273 = getelementptr [17 x i8], [17 x i8]* @.LC12, i64 0, i64 0 ; [#uses=0] + %cast273 = getelementptr [17 x i8], ptr @.LC12, i64 0, i64 0 ; [#uses=0] br label %bb3 bb3: ; preds = %bb2, %0 @@ -38,31 +38,30 @@ bb3: ; preds = %bb2, %0 br i1 %cond267, label %bb5, label %bb4 bb4: ; preds = %bb3 - %reg111 = getelementptr [20 x %FILE], [20 x %FILE]* @__iob, i64 0, i64 1, i32 3 ; [#uses=1] - %cast274 = getelementptr [34 x i8], [34 x i8]* @.LC9, i64 0, i64 0 ; [#uses=0] - %cast282 = bitcast i8* %reg111 to %FILE* ; <%FILE*> [#uses=0] + %reg111 = getelementptr [20 x %FILE], ptr @__iob, i64 0, i64 1, i32 3 ; [#uses=1] + %cast274 = getelementptr [34 x i8], ptr @.LC9, i64 0, i64 0 ; [#uses=0] call void @exit( i32 1 ) br label %UnifiedExitNode bb5: ; preds = %bb3 %reg107-idxcast1 = sext i32 %fd to i64 ; [#uses=2] %reg107-idxcast2 = sext i32 %fd to i64 ; [#uses=1] - %reg1311 = getelementptr [3 x %spec_fd_t], [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast2 ; <%spec_fd_t*> [#uses=1] - %idx1 = getelementptr [3 x %spec_fd_t], [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; [#uses=1] - %reg1321 = load i32, i32* %idx1 ; [#uses=3] - %idx2 = getelementptr %spec_fd_t, %spec_fd_t* %reg1311, i64 0, i32 1 ; [#uses=1] - %reg1331 = load i32, i32* %idx2 ; [#uses=1] + %reg1311 = getelementptr [3 x %spec_fd_t], ptr @spec_fd, i64 0, i64 %reg107-idxcast2 ; [#uses=1] + %idx1 = getelementptr [3 x %spec_fd_t], ptr @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; [#uses=1] + %reg1321 = load i32, ptr %idx1 ; [#uses=3] + %idx2 = getelementptr %spec_fd_t, ptr %reg1311, i64 0, i32 1 ; [#uses=1] + %reg1331 = load i32, ptr %idx2 ; [#uses=1] %cond270 = icmp slt i32 %reg1321, %reg1331 ; [#uses=1] br i1 %cond270, label %bb9, label %bb6 bb6: ; preds = %bb5 - %reg134 = load i32, i32* @dbglvl ; [#uses=1] + %reg134 = load i32, ptr @dbglvl ; [#uses=1] %cond271 = icmp sle i32 %reg134, 4 ; [#uses=1] ; CHECK: br label %bb8 br i1 %cond271, label %bb8, label %bb7 bb7: ; preds = %bb6 - %cast277 = getelementptr [4 x i8], [4 x i8]* @.LC10, i64 0, i64 0 ; [#uses=0] + %cast277 = getelementptr [4 x i8], ptr @.LC10, i64 0, i64 0 ; [#uses=0] br label %bb8 bb8: ; preds = %bb7, %bb6 @@ -70,22 +69,22 @@ bb8: ; preds = %bb7, %bb6 bb9: ; preds = %bb5 %reg107-idxcast3 = sext i32 %fd to i64 ; [#uses=1] - %idx3 = getelementptr [3 x %spec_fd_t], [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast3, i32 3 ; [#uses=1] - %reg1601 = load i8*, i8** %idx3 ; [#uses=1] + %idx3 = getelementptr [3 x %spec_fd_t], ptr @spec_fd, i64 0, i64 %reg107-idxcast3, i32 3 ; [#uses=1] + %reg1601 = load ptr, ptr %idx3 ; [#uses=1] %reg132-idxcast1 = sext i32 %reg1321 to i64 ; [#uses=1] - %idx4 = getelementptr i8, i8* %reg1601, i64 %reg132-idxcast1 ; [#uses=1] - %reg1621 = load i8, i8* %idx4 ; [#uses=2] + %idx4 = getelementptr i8, ptr %reg1601, i64 %reg132-idxcast1 ; [#uses=1] + %reg1621 = load i8, ptr %idx4 ; [#uses=2] %cast108 = zext i8 %reg1621 to i64 ; [#uses=0] %reg157 = add i32 %reg1321, 1 ; [#uses=1] - %idx5 = getelementptr [3 x %spec_fd_t], [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; [#uses=1] - store i32 %reg157, i32* %idx5 - %reg163 = load i32, i32* @dbglvl ; [#uses=1] + %idx5 = getelementptr [3 x %spec_fd_t], ptr @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; [#uses=1] + store i32 %reg157, ptr %idx5 + %reg163 = load i32, ptr @dbglvl ; [#uses=1] %cond272 = icmp sle i32 %reg163, 4 ; [#uses=1] ; CHECK: br label %bb11 br i1 %cond272, label %bb11, label %bb10 bb10: ; preds = %bb9 - %cast279 = getelementptr [4 x i8], [4 x i8]* @.LC11, i64 0, i64 0 ; [#uses=0] + %cast279 = getelementptr [4 x i8], ptr @.LC11, i64 0, i64 0 ; [#uses=0] br label %bb11 bb11: ; preds = %bb10, %bb9 @@ -97,6 +96,6 @@ UnifiedExitNode: ; preds = %bb11, %bb8, %bb4 ret i32 %UnifiedRetVal } -declare i32 @puts(i8*) +declare i32 @puts(ptr) -declare i32 @printf(i8*, ...) +declare i32 @printf(ptr, ...) diff --git a/llvm/test/Transforms/ADCE/basictest2.ll b/llvm/test/Transforms/ADCE/basictest2.ll index cdcef36adec3..58400d5cb3ec 100644 --- a/llvm/test/Transforms/ADCE/basictest2.ll +++ b/llvm/test/Transforms/ADCE/basictest2.ll @@ -1,36 +1,36 @@ ; RUN: opt < %s -passes=adce -disable-output ; RUN: opt < %s -passes=adce -adce-remove-loops -S | FileCheck %s - %FILE = type { i32, i8*, i8*, i8, i8, i32, i32, i32 } - %spec_fd_t = type { i32, i32, i32, i8* } -@__iob = external global [20 x %FILE] ; <[20 x %FILE]*> [#uses=1] -@dbglvl = global i32 4 ; [#uses=3] -@spec_fd = external global [3 x %spec_fd_t] ; <[3 x %spec_fd_t]*> [#uses=4] -@.LC9 = internal global [34 x i8] c"spec_read: fd=%d, > MAX_SPEC_FD!\0A\00" ; <[34 x i8]*> [#uses=1] -@.LC10 = internal global [4 x i8] c"EOF\00" ; <[4 x i8]*> [#uses=1] -@.LC11 = internal global [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1] -@.LC12 = internal global [17 x i8] c"spec_getc: %d = \00" ; <[17 x i8]*> [#uses=1] + %FILE = type { i32, ptr, ptr, i8, i8, i32, i32, i32 } + %spec_fd_t = type { i32, i32, i32, ptr } +@__iob = external global [20 x %FILE] ; [#uses=1] +@dbglvl = global i32 4 ; [#uses=3] +@spec_fd = external global [3 x %spec_fd_t] ; [#uses=4] +@.LC9 = internal global [34 x i8] c"spec_read: fd=%d, > MAX_SPEC_FD!\0A\00" ; [#uses=1] +@.LC10 = internal global [4 x i8] c"EOF\00" ; [#uses=1] +@.LC11 = internal global [4 x i8] c"%d\0A\00" ; [#uses=1] +@.LC12 = internal global [17 x i8] c"spec_getc: %d = \00" ; [#uses=1] -declare i32 @fprintf(%FILE*, i8*, ...) +declare i32 @fprintf(ptr, ptr, ...) declare void @exit(i32) -declare i32 @remove(i8*) +declare i32 @remove(ptr) -declare i32 @fputc(i32, %FILE*) +declare i32 @fputc(i32, ptr) -declare i32 @fwrite(i8*, i32, i32, %FILE*) +declare i32 @fwrite(ptr, i32, i32, ptr) -declare void @perror(i8*) +declare void @perror(ptr) define i32 @spec_getc(i32 %fd) { - %reg109 = load i32, i32* @dbglvl ; [#uses=1] + %reg109 = load i32, ptr @dbglvl ; [#uses=1] %cond266 = icmp sle i32 %reg109, 4 ; [#uses=1] ; CHECK: br label %bb3 br i1 %cond266, label %bb3, label %bb2 bb2: ; preds = %0 - %cast273 = getelementptr [17 x i8], [17 x i8]* @.LC12, i64 0, i64 0 ; [#uses=0] + %cast273 = getelementptr [17 x i8], ptr @.LC12, i64 0, i64 0 ; [#uses=0] br label %bb3 bb3: ; preds = %bb2, %0 @@ -38,31 +38,30 @@ bb3: ; preds = %bb2, %0 br label %bb5 bb4: ; No predecessors! - %reg111 = getelementptr [20 x %FILE], [20 x %FILE]* @__iob, i64 0, i64 1, i32 3 ; [#uses=1] - %cast274 = getelementptr [34 x i8], [34 x i8]* @.LC9, i64 0, i64 0 ; [#uses=0] - %cast282 = bitcast i8* %reg111 to %FILE* ; <%FILE*> [#uses=0] + %reg111 = getelementptr [20 x %FILE], ptr @__iob, i64 0, i64 1, i32 3 ; [#uses=1] + %cast274 = getelementptr [34 x i8], ptr @.LC9, i64 0, i64 0 ; [#uses=0] call void @exit( i32 1 ) br label %UnifiedExitNode bb5: ; preds = %bb3 %reg107-idxcast1 = sext i32 %fd to i64 ; [#uses=2] %reg107-idxcast2 = sext i32 %fd to i64 ; [#uses=1] - %reg1311 = getelementptr [3 x %spec_fd_t], [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast2 ; <%spec_fd_t*> [#uses=1] - %idx1 = getelementptr [3 x %spec_fd_t], [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; [#uses=1] - %reg1321 = load i32, i32* %idx1 ; [#uses=3] - %idx2 = getelementptr %spec_fd_t, %spec_fd_t* %reg1311, i64 0, i32 1 ; [#uses=1] - %reg1331 = load i32, i32* %idx2 ; [#uses=1] + %reg1311 = getelementptr [3 x %spec_fd_t], ptr @spec_fd, i64 0, i64 %reg107-idxcast2 ; [#uses=1] + %idx1 = getelementptr [3 x %spec_fd_t], ptr @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; [#uses=1] + %reg1321 = load i32, ptr %idx1 ; [#uses=3] + %idx2 = getelementptr %spec_fd_t, ptr %reg1311, i64 0, i32 1 ; [#uses=1] + %reg1331 = load i32, ptr %idx2 ; [#uses=1] %cond270 = icmp slt i32 %reg1321, %reg1331 ; [#uses=1] br i1 %cond270, label %bb9, label %bb6 bb6: ; preds = %bb5 - %reg134 = load i32, i32* @dbglvl ; [#uses=1] + %reg134 = load i32, ptr @dbglvl ; [#uses=1] %cond271 = icmp sle i32 %reg134, 4 ; [#uses=1] ; CHECK: br label %bb8 br i1 %cond271, label %bb8, label %bb7 bb7: ; preds = %bb6 - %cast277 = getelementptr [4 x i8], [4 x i8]* @.LC10, i64 0, i64 0 ; [#uses=0] + %cast277 = getelementptr [4 x i8], ptr @.LC10, i64 0, i64 0 ; [#uses=0] br label %bb8 bb8: ; preds = %bb7, %bb6 @@ -70,22 +69,22 @@ bb8: ; preds = %bb7, %bb6 bb9: ; preds = %bb5 %reg107-idxcast3 = sext i32 %fd to i64 ; [#uses=1] - %idx3 = getelementptr [3 x %spec_fd_t], [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast3, i32 3 ; [#uses=1] - %reg1601 = load i8*, i8** %idx3 ; [#uses=1] + %idx3 = getelementptr [3 x %spec_fd_t], ptr @spec_fd, i64 0, i64 %reg107-idxcast3, i32 3 ; [#uses=1] + %reg1601 = load ptr, ptr %idx3 ; [#uses=1] %reg132-idxcast1 = sext i32 %reg1321 to i64 ; [#uses=1] - %idx4 = getelementptr i8, i8* %reg1601, i64 %reg132-idxcast1 ; [#uses=1] - %reg1621 = load i8, i8* %idx4 ; [#uses=2] + %idx4 = getelementptr i8, ptr %reg1601, i64 %reg132-idxcast1 ; [#uses=1] + %reg1621 = load i8, ptr %idx4 ; [#uses=2] %cast108 = zext i8 %reg1621 to i64 ; [#uses=0] %reg157 = add i32 %reg1321, 1 ; [#uses=1] - %idx5 = getelementptr [3 x %spec_fd_t], [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; [#uses=1] - store i32 %reg157, i32* %idx5 - %reg163 = load i32, i32* @dbglvl ; [#uses=1] + %idx5 = getelementptr [3 x %spec_fd_t], ptr @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; [#uses=1] + store i32 %reg157, ptr %idx5 + %reg163 = load i32, ptr @dbglvl ; [#uses=1] %cond272 = icmp sle i32 %reg163, 4 ; [#uses=1] ; CHECK: br label %bb11 br i1 %cond272, label %bb11, label %bb10 bb10: ; preds = %bb9 - %cast279 = getelementptr [4 x i8], [4 x i8]* @.LC11, i64 0, i64 0 ; [#uses=0] + %cast279 = getelementptr [4 x i8], ptr @.LC11, i64 0, i64 0 ; [#uses=0] br label %bb11 bb11: ; preds = %bb10, %bb9 @@ -97,6 +96,6 @@ UnifiedExitNode: ; preds = %bb11, %bb8, %bb4 ret i32 %UnifiedRetVal } -declare i32 @puts(i8*) +declare i32 @puts(ptr) -declare i32 @printf(i8*, ...) +declare i32 @printf(ptr, ...) diff --git a/llvm/test/Transforms/ADCE/dce_pure_call.ll b/llvm/test/Transforms/ADCE/dce_pure_call.ll index f316c7fcb6b9..a91770eb5772 100644 --- a/llvm/test/Transforms/ADCE/dce_pure_call.ll +++ b/llvm/test/Transforms/ADCE/dce_pure_call.ll @@ -1,8 +1,8 @@ ; RUN: opt -passes=adce -S < %s | not grep call -declare i32 @strlen(i8*) readonly nounwind willreturn +declare i32 @strlen(ptr) readonly nounwind willreturn define void @test() { - call i32 @strlen( i8* null ) ; :1 [#uses=0] + call i32 @strlen( ptr null ) ; :1 [#uses=0] ret void } diff --git a/llvm/test/Transforms/ADCE/dce_pure_invoke.ll b/llvm/test/Transforms/ADCE/dce_pure_invoke.ll index c7f591acd470..99fcf795a7c2 100644 --- a/llvm/test/Transforms/ADCE/dce_pure_invoke.ll +++ b/llvm/test/Transforms/ADCE/dce_pure_invoke.ll @@ -1,17 +1,17 @@ ; RUN: opt < %s -passes=adce -S | grep null -declare i32 @strlen(i8*) readnone +declare i32 @strlen(ptr) readnone -define i32 @test() personality i32 (...)* @__gxx_personality_v0 { +define i32 @test() personality ptr @__gxx_personality_v0 { ; invoke of pure function should not be deleted! - invoke i32 @strlen( i8* null ) readnone + invoke i32 @strlen( ptr null ) readnone to label %Cont unwind label %Other ; :1 [#uses=0] Cont: ; preds = %0 ret i32 0 Other: ; preds = %0 - %exn = landingpad {i8*, i32} + %exn = landingpad {ptr, i32} cleanup ret i32 1 } diff --git a/llvm/test/Transforms/ADCE/delete-profiling-calls-to-constant.ll b/llvm/test/Transforms/ADCE/delete-profiling-calls-to-constant.ll index 458ab11f80b6..61fd74d49e28 100644 --- a/llvm/test/Transforms/ADCE/delete-profiling-calls-to-constant.ll +++ b/llvm/test/Transforms/ADCE/delete-profiling-calls-to-constant.ll @@ -3,16 +3,16 @@ ; Verify that a call to instrument a constant is deleted. @__profc_foo = private global [1 x i64] zeroinitializer, section "__llvm_prf_cnts", align 8 -@__profd_foo = private global { i64, i64, i64*, i8*, i8*, i32, [1 x i16] } { i64 6699318081062747564, i64 0, i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc_foo, i32 0, i32 0), i8* bitcast (i32 ()* @foo to i8*), i8* null, i32 1, [1 x i16] [i16 1] }, section "__llvm_prf_data", align 8 +@__profd_foo = private global { i64, i64, ptr, ptr, ptr, i32, [1 x i16] } { i64 6699318081062747564, i64 0, ptr @__profc_foo, ptr @foo, ptr null, i32 1, [1 x i16] [i16 1] }, section "__llvm_prf_data", align 8 define i32 @foo() { ; CHECK-NOT: call void @__llvm_profile_instrument_target entry: - tail call void @__llvm_profile_instrument_target(i64 ptrtoint (i32 (i32)* @bar to i64), i8* bitcast ({ i64, i64, i64*, i8*, i8*, i32, [1 x i16] }* @__profd_foo to i8*), i32 0) + tail call void @__llvm_profile_instrument_target(i64 ptrtoint (ptr @bar to i64), ptr @__profd_foo, i32 0) %call = tail call i32 @bar(i32 21) ret i32 %call } declare i32 @bar(i32) -declare void @__llvm_profile_instrument_target(i64, i8*, i32) +declare void @__llvm_profile_instrument_target(i64, ptr, i32) diff --git a/llvm/test/Transforms/ADCE/domtree-DoubleDeletion.ll b/llvm/test/Transforms/ADCE/domtree-DoubleDeletion.ll index 1175288cd09e..9ad60d674ce7 100644 --- a/llvm/test/Transforms/ADCE/domtree-DoubleDeletion.ll +++ b/llvm/test/Transforms/ADCE/domtree-DoubleDeletion.ll @@ -11,13 +11,13 @@ define i32 @main() { entry: %retval = alloca i32, align 4 - store i32 0, i32* %retval, align 4 - %0 = load i32, i32* @a, align 4 + store i32 0, ptr %retval, align 4 + %0 = load i32, ptr @a, align 4 %cmp = icmp ne i32 %0, 1 br i1 %cmp, label %land.rhs, label %land.end4 land.rhs: ; preds = %entry - %1 = load i32, i32* @a, align 4 + %1 = load i32, ptr @a, align 4 %tobool = icmp ne i32 %1, 0 br i1 %tobool, label %land.rhs1, label %land.end