From e6d5d39c072d3b16ff4183c515d7ccf198192958 Mon Sep 17 00:00:00 2001 From: Tanya Lattner Date: Wed, 19 Mar 2008 07:28:33 +0000 Subject: Upgrade tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48538 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../LoopStrengthReduce/2005-08-15-AddRecIV.ll | 62 +- .../2005-08-17-OutOfLoopVariant.ll | 27 +- .../2005-09-12-UsesOutOutsideOfLoop.ll | 33 +- .../LoopStrengthReduce/different-type-ivs.ll | 31 +- .../dont-hoist-simple-loop-constants.ll | 35 +- .../dont_insert_redundant_ops.ll | 56 +- .../LoopStrengthReduce/dont_reduce_bytes.ll | 27 +- .../LoopStrengthReduce/exit_compare_live_range.ll | 21 +- .../LoopStrengthReduce/invariant_value_first.ll | 31 +- .../invariant_value_first_arg.ll | 26 +- .../Transforms/LoopStrengthReduce/nested-reduce.ll | 73 +- .../LoopStrengthReduce/ops_after_indvar.ll | 30 +- .../phi_node_update_multiple_preds.ll | 37 +- .../LoopStrengthReduce/related_indvars.ll | 27 +- .../Transforms/LoopStrengthReduce/remove_indvar.ll | 26 +- .../LoopStrengthReduce/share_code_in_preheader.ll | 45 +- test/Transforms/LoopStrengthReduce/share_ivs.ll | 30 +- .../use_postinc_value_outside_loop.ll | 36 +- .../var_stride_used_by_compare.ll | 52 +- .../LoopStrengthReduce/variable_stride.ll | 23 +- .../LoopUnroll/2004-05-13-DontUnrollTooMuch.ll | 23 +- .../LoopUnroll/2005-03-06-BadLoopInfoUpdate.ll | 25 +- .../LoopUnroll/2006-08-24-MultiBlockLoop.ll | 22 +- test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll | 7 +- .../LoopUnswitch/2006-02-14-LoopSimplifyCrash.ll | 3082 ++++++++++---------- .../LoopUnswitch/2006-02-22-UnswitchCrash.ll | 34 +- .../LoopUnswitch/2006-06-13-SingleEntryPHI.ll | 33 +- .../LoopUnswitch/2006-06-27-DeadSwitchCase.ll | 26 +- .../LoopUnswitch/2007-05-09-Unreachable.ll | 12 +- test/Transforms/LoopUnswitch/basictest.ll | 52 +- test/Transforms/LowerInvoke/2003-12-10-Crash.llx | 26 +- .../Transforms/LowerInvoke/2004-02-29-PHICrash.llx | 17 +- .../LowerInvoke/2005-08-03-InvokeWithPHI.ll | 19 +- .../LowerInvoke/2005-08-03-InvokeWithPHIUse.ll | 19 +- test/Transforms/LowerInvoke/basictest.ll | 45 +- .../LowerSetJmp/2003-11-05-DominanceProperties.ll | 20 +- test/Transforms/LowerSetJmp/simpletest.ll | 46 +- .../LowerSwitch/2003-05-01-PHIProblem.ll | 28 +- .../LowerSwitch/2003-08-23-EmptySwitch.ll | 10 +- .../LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll | 20 +- .../Mem2Reg/2003-04-18-DeadBlockProblem.ll | 19 +- .../2003-04-24-MultipleIdenticalSuccessors.ll | 21 +- .../Mem2Reg/2003-06-26-IterativePromote.ll | 24 +- .../Mem2Reg/2003-10-05-DeadPHIInsertion.ll | 27 +- .../Mem2Reg/2005-06-30-ReadBeforeWrite.ll | 72 +- test/Transforms/Mem2Reg/2005-11-28-Crash.ll | 54 +- test/Transforms/Mem2Reg/PromoteMemToRegister.ll | 34 +- test/Transforms/Mem2Reg/UndefValuesMerge.ll | 21 +- 48 files changed, 2209 insertions(+), 2357 deletions(-) (limited to 'test') diff --git a/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll b/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll index b210405..75574c0 100644 --- a/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll +++ b/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll @@ -1,77 +1,57 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce -disable-output +; RUN: llvm-as < %s | opt -loop-reduce -disable-output -void %try_swap() { +define void @try_swap() { entry: - br bool false, label %cond_continue.0.i, label %cond_false.0.i - + br i1 false, label %cond_continue.0.i, label %cond_false.0.i cond_false.0.i: ; preds = %entry ret void - cond_continue.0.i: ; preds = %entry - br bool false, label %cond_continue.1.i, label %cond_false.1.i - + br i1 false, label %cond_continue.1.i, label %cond_false.1.i cond_false.1.i: ; preds = %cond_continue.0.i ret void - cond_continue.1.i: ; preds = %cond_continue.0.i - br bool false, label %endif.3.i, label %else.0.i - + br i1 false, label %endif.3.i, label %else.0.i endif.3.i: ; preds = %cond_continue.1.i - br bool false, label %my_irand.exit82, label %endif.0.i62 - + br i1 false, label %my_irand.exit82, label %endif.0.i62 else.0.i: ; preds = %cond_continue.1.i ret void - endif.0.i62: ; preds = %endif.3.i ret void - my_irand.exit82: ; preds = %endif.3.i - br bool false, label %else.2, label %then.4 - + br i1 false, label %else.2, label %then.4 then.4: ; preds = %my_irand.exit82 ret void - else.2: ; preds = %my_irand.exit82 - br bool false, label %find_affected_nets.exit, label %loopentry.1.i107.outer.preheader - + br i1 false, label %find_affected_nets.exit, label %loopentry.1.i107.outer.preheader loopentry.1.i107.outer.preheader: ; preds = %else.2 ret void - find_affected_nets.exit: ; preds = %else.2 - br bool false, label %save_region_occ.exit, label %loopentry.1 - + br i1 false, label %save_region_occ.exit, label %loopentry.1 save_region_occ.exit: ; preds = %find_affected_nets.exit - br bool false, label %no_exit.1.preheader, label %loopexit.1 - + br i1 false, label %no_exit.1.preheader, label %loopexit.1 loopentry.1: ; preds = %find_affected_nets.exit ret void - no_exit.1.preheader: ; preds = %save_region_occ.exit ret void - loopexit.1: ; preds = %save_region_occ.exit - br bool false, label %then.10, label %loopentry.3 - + br i1 false, label %then.10, label %loopentry.3 then.10: ; preds = %loopexit.1 ret void - loopentry.3: ; preds = %endif.16, %loopexit.1 - %indvar342 = phi uint [ %indvar.next343, %endif.16 ], [ 0, %loopexit.1 ] ; [#uses=2] - br bool false, label %loopexit.3, label %endif.16 - + %indvar342 = phi i32 [ %indvar.next343, %endif.16 ], [ 0, %loopexit.1 ] ; [#uses=2] + br i1 false, label %loopexit.3, label %endif.16 endif.16: ; preds = %loopentry.3 - %indvar.next343 = add uint %indvar342, 1 ; [#uses=1] + %indvar.next343 = add i32 %indvar342, 1 ; [#uses=1] br label %loopentry.3 - loopexit.3: ; preds = %loopentry.3 br label %loopentry.4 - loopentry.4: ; preds = %loopentry.4, %loopexit.3 - %indvar340 = phi uint [ 0, %loopexit.3 ], [ %indvar.next341, %loopentry.4 ] ; [#uses=2] - %tmp. = add uint %indvar340, %indvar342 ; [#uses=1] - %tmp.526 = load int** null ; [#uses=1] - %tmp.528 = getelementptr int* %tmp.526, uint %tmp. ; [#uses=1] - store int 0, int* %tmp.528 - %indvar.next341 = add uint %indvar340, 1 ; [#uses=1] + %indvar340 = phi i32 [ 0, %loopexit.3 ], [ %indvar.next341, %loopentry.4 ] ; [#uses=2] + %tmp. = add i32 %indvar340, %indvar342 ; [#uses=1] + %tmp.526 = load i32** null ; [#uses=1] + %gep.upgrd.1 = zext i32 %tmp. to i64 ; [#uses=1] + %tmp.528 = getelementptr i32* %tmp.526, i64 %gep.upgrd.1 ; [#uses=1] + store i32 0, i32* %tmp.528 + %indvar.next341 = add i32 %indvar340, 1 ; [#uses=1] br label %loopentry.4 } diff --git a/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll b/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll index 5724bad..83d4696 100644 --- a/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll +++ b/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll @@ -1,18 +1,17 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce -disable-output +; RUN: llvm-as < %s | opt -loop-reduce -disable-output -int %image_to_texture(uint %indvar454) { +define i32 @image_to_texture(i32 %indvar454) { loopentry.1.outer: - %j.2.1.ph = cast uint %indvar454 to int ; [#uses=1] + %j.2.1.ph = bitcast i32 %indvar454 to i32 ; [#uses=1] br label %loopentry.1 - -loopentry.1: ; preds = %label.5, %loopentry.1.outer - %i.3 = phi int [ 0, %loopentry.1.outer ], [ %i.3.be, %loopentry.1 ] - %tmp.390 = load int* null ; [#uses=1] - %tmp.392 = mul int %tmp.390, %j.2.1.ph ; [#uses=1] - %tmp.394 = add int %tmp.392, %i.3 ; [#uses=1] - %i.3.be = add int %i.3, 1 ; [#uses=1] - br bool false, label %loopentry.1, label %label.6 - -label.6: ; preds = %no_exit.1 - ret int %tmp.394 +loopentry.1: ; preds = %loopentry.1, %loopentry.1.outer + %i.3 = phi i32 [ 0, %loopentry.1.outer ], [ %i.3.be, %loopentry.1 ] ; [#uses=2] + %tmp.390 = load i32* null ; [#uses=1] + %tmp.392 = mul i32 %tmp.390, %j.2.1.ph ; [#uses=1] + %tmp.394 = add i32 %tmp.392, %i.3 ; [#uses=1] + %i.3.be = add i32 %i.3, 1 ; [#uses=1] + br i1 false, label %loopentry.1, label %label.6 +label.6: ; preds = %loopentry.1 + ret i32 %tmp.394 } + diff --git a/test/Transforms/LoopStrengthReduce/2005-09-12-UsesOutOutsideOfLoop.ll b/test/Transforms/LoopStrengthReduce/2005-09-12-UsesOutOutsideOfLoop.ll index 81d3c25..145551b 100644 --- a/test/Transforms/LoopStrengthReduce/2005-09-12-UsesOutOutsideOfLoop.ll +++ b/test/Transforms/LoopStrengthReduce/2005-09-12-UsesOutOutsideOfLoop.ll @@ -1,43 +1,32 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce -disable-output +; RUN: llvm-as < %s | opt -loop-reduce -disable-output -void %main() { +define void @main() { entry: br label %loopentry.0 - loopentry.0: ; preds = %then.5, %entry - %arg_index.1.ph = phi int [ 1, %entry ], [ %arg_index.1.ph.be, %then.5 ] ; [#uses=1] - br bool false, label %no_exit.0, label %loopexit.0 - + %arg_index.1.ph = phi i32 [ 1, %entry ], [ %arg_index.1.ph.be, %then.5 ] ; [#uses=1] + br i1 false, label %no_exit.0, label %loopexit.0 no_exit.0: ; preds = %loopentry.0 - %arg_index.1.1 = add int 0, %arg_index.1.ph ; [#uses=2] - br bool false, label %then.i55, label %endif.i61 - + %arg_index.1.1 = add i32 0, %arg_index.1.ph ; [#uses=2] + br i1 false, label %then.i55, label %endif.i61 then.i55: ; preds = %no_exit.0 - br bool false, label %then.4, label %else.1 - + br i1 false, label %then.4, label %else.1 endif.i61: ; preds = %no_exit.0 ret void - then.4: ; preds = %then.i55 - %tmp.19993 = add int %arg_index.1.1, 2 ; [#uses=0] + %tmp.19993 = add i32 %arg_index.1.1, 2 ; [#uses=0] ret void - else.1: ; preds = %then.i55 - br bool false, label %then.i86, label %loopexit.i97 - + br i1 false, label %then.i86, label %loopexit.i97 then.i86: ; preds = %else.1 ret void - loopexit.i97: ; preds = %else.1 - br bool false, label %then.5, label %else.2 - + br i1 false, label %then.5, label %else.2 then.5: ; preds = %loopexit.i97 - %arg_index.1.ph.be = add int %arg_index.1.1, 2 ; [#uses=1] + %arg_index.1.ph.be = add i32 %arg_index.1.1, 2 ; [#uses=1] br label %loopentry.0 - else.2: ; preds = %loopexit.i97 ret void - loopexit.0: ; preds = %loopentry.0 ret void } diff --git a/test/Transforms/LoopStrengthReduce/different-type-ivs.ll b/test/Transforms/LoopStrengthReduce/different-type-ivs.ll index 1383fd6..e5225da 100644 --- a/test/Transforms/LoopStrengthReduce/different-type-ivs.ll +++ b/test/Transforms/LoopStrengthReduce/different-type-ivs.ll @@ -1,26 +1,25 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce -disable-output +; RUN: llvm-as < %s | opt -loop-reduce -disable-output ; Test to make sure that loop-reduce never crashes on IV's ; with different types but identical strides. -void %foo() { +define void @foo() { entry: br label %no_exit - no_exit: ; preds = %no_exit, %entry - %indvar = phi uint [ 0, %entry ], [ %indvar.next, %no_exit ] ; [#uses=3] - %indvar = cast uint %indvar to short ; [#uses=1] - %X.0.0 = mul short %indvar, 1234 ; [#uses=1] - %tmp. = mul uint %indvar, 1234 ; [#uses=1] - %tmp.5 = cast short %X.0.0 to int ; [#uses=1] - %tmp.3 = call int (...)* %bar( int %tmp.5, uint %tmp. ) ; [#uses=0] - %tmp.0 = call bool %pred( ) ; [#uses=1] - %indvar.next = add uint %indvar, 1 ; [#uses=1] - br bool %tmp.0, label %return, label %no_exit - -return: + %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %no_exit ] ; [#uses=3] + %indvar.upgrd.1 = trunc i32 %indvar to i16 ; [#uses=1] + %X.0.0 = mul i16 %indvar.upgrd.1, 1234 ; [#uses=1] + %tmp. = mul i32 %indvar, 1234 ; [#uses=1] + %tmp.5 = sext i16 %X.0.0 to i32 ; [#uses=1] + %tmp.3 = call i32 (...)* @bar( i32 %tmp.5, i32 %tmp. ) ; [#uses=0] + %tmp.0 = call i1 @pred( ) ; [#uses=1] + %indvar.next = add i32 %indvar, 1 ; [#uses=1] + br i1 %tmp.0, label %return, label %no_exit +return: ; preds = %no_exit ret void } -declare bool %pred() +declare i1 @pred() + +declare i32 @bar(...) -declare int %bar(...) diff --git a/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll b/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll index 3c1003b..56773ac 100644 --- a/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll +++ b/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll @@ -1,26 +1,23 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | \ +; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | \ ; RUN: not grep {cast uint 1 to uint} ; END. ; The setlt wants to use a value that is incremented one more than the dominant ; IV. Don't insert the 1 outside the loop, preventing folding it into the add. -implementation ; Functions: - -void %test([700 x int]* %nbeaux_.0__558, int* %i_.16574) { +define void @test([700 x i32]* %nbeaux_.0__558, i32* %i_.16574) { then.0: - br label %no_exit.2 - -no_exit.2: ; preds = %no_exit.2, %then.0 - %indvar630 = phi uint [ 0, %then.0 ], [ %indvar.next631, %no_exit.2 ] ; [#uses=3] - %indvar630 = cast uint %indvar630 to int ; [#uses=1] - %tmp.38 = getelementptr [700 x int]* %nbeaux_.0__558, int 0, uint %indvar630 ; [#uses=1] - store int 0, int* %tmp.38 - %inc.2 = add int %indvar630, 2 ; [#uses=2] - %tmp.34 = setlt int %inc.2, 701 ; [#uses=1] - %indvar.next631 = add uint %indvar630, 1 ; [#uses=1] - br bool %tmp.34, label %no_exit.2, label %loopexit.2.loopexit - -loopexit.2.loopexit: ; preds = %no_exit.2 - store int %inc.2, int* %i_.16574 - ret void + br label %no_exit.2 +no_exit.2: ; preds = %no_exit.2, %then.0 + %indvar630 = phi i32 [ 0, %then.0 ], [ %indvar.next631, %no_exit.2 ] ; [#uses=4] + %gep.upgrd.1 = zext i32 %indvar630 to i64 ; [#uses=1] + %tmp.38 = getelementptr [700 x i32]* %nbeaux_.0__558, i32 0, i64 %gep.upgrd.1 ; [#uses=1] + store i32 0, i32* %tmp.38 + %inc.2 = add i32 %indvar630, 2 ; [#uses=2] + %tmp.34 = icmp slt i32 %inc.2, 701 ; [#uses=1] + %indvar.next631 = add i32 %indvar630, 1 ; [#uses=1] + br i1 %tmp.34, label %no_exit.2, label %loopexit.2.loopexit +loopexit.2.loopexit: ; preds = %no_exit.2 + store i32 %inc.2, i32* %i_.16574 + ret void } + diff --git a/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll b/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll index 1954a20..68eb107 100644 --- a/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll +++ b/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll @@ -1,40 +1,36 @@ ; Check that this test makes INDVAR and related stuff dead. -; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | grep phi | count 2 +; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep phi | count 2 -declare bool %pred() +declare i1 @pred() -void %test1({ int, int }* %P) { +define void @test1({ i32, i32 }* %P) { +;