diff options
author | Tanya Lattner <tonic@nondot.org> | 2008-03-25 04:26:08 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2008-03-25 04:26:08 +0000 |
commit | 6f729d601c8a6a9710356aadb42dc8d0efa95bf2 (patch) | |
tree | e662b3ee5539d7594ab49eda3eae140424ce499d /test/Transforms/LoopSimplify | |
parent | a2fb634defce316ec972aa6f3ca3a941b4656f5e (diff) | |
download | external_llvm-6f729d601c8a6a9710356aadb42dc8d0efa95bf2.zip external_llvm-6f729d601c8a6a9710356aadb42dc8d0efa95bf2.tar.gz external_llvm-6f729d601c8a6a9710356aadb42dc8d0efa95bf2.tar.bz2 |
Byebye llvm-upgrade!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48762 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LoopSimplify')
13 files changed, 211 insertions, 271 deletions
diff --git a/test/Transforms/LoopSimplify/2003-04-25-AssertFail.ll b/test/Transforms/LoopSimplify/2003-04-25-AssertFail.ll index 90de721..70445fb 100644 --- a/test/Transforms/LoopSimplify/2003-04-25-AssertFail.ll +++ b/test/Transforms/LoopSimplify/2003-04-25-AssertFail.ll @@ -1,25 +1,20 @@ ; This testcase exposed a problem with the loop identification pass (LoopInfo). ; Basically, it was incorrectly calculating the loop nesting information. ; -; RUN: llvm-upgrade < %s | llvm-as | opt -loopsimplify +; RUN: llvm-as < %s | opt -loopsimplify -implementation ; Functions: - -int %yylex() { ; No predecessors! +define i32 @yylex() { br label %loopentry.0 - -loopentry.0: ; preds = %0, %yy_find_action, %else.4 +loopentry.0: ; preds = %else.4, %0 br label %loopexit.2 - -loopexit.2: ; preds = %loopentry.0, %else.4, %loopexit.2 - br bool false, label %loopexit.2, label %else.4 - -yy_find_action: ; preds = %loopexit.2, %else.4 +loopexit.2: ; preds = %else.4, %loopexit.2, %loopentry.0 + br i1 false, label %loopexit.2, label %else.4 +yy_find_action: ; preds = %else.4 br label %else.4 - -else.4: ; preds = %yy_find_action - switch uint 0, label %loopexit.2 [ - uint 2, label %yy_find_action - uint 0, label %loopentry.0 +else.4: ; preds = %yy_find_action, %loopexit.2 + switch i32 0, label %loopexit.2 [ + i32 2, label %yy_find_action + i32 0, label %loopentry.0 ] } + diff --git a/test/Transforms/LoopSimplify/2003-05-12-PreheaderExitOfChild.ll b/test/Transforms/LoopSimplify/2003-05-12-PreheaderExitOfChild.ll index 0880da6..ba2eef7 100644 --- a/test/Transforms/LoopSimplify/2003-05-12-PreheaderExitOfChild.ll +++ b/test/Transforms/LoopSimplify/2003-05-12-PreheaderExitOfChild.ll @@ -2,56 +2,41 @@ ; inserted for the "fail" loop, but the exit block of a loop is not updated ; to be the preheader instead of the exit loop itself. -; RUN: llvm-upgrade < %s | llvm-as | opt -loopsimplify - -int %re_match_2() { +; RUN: llvm-as < %s | opt -loopsimplify +define i32 @re_match_2() { br label %loopentry.1 - -loopentry.1: ; preds = %then.6, %endif.7, %loopexit.20, %endif.83 +loopentry.1: ; preds = %endif.82, %0 br label %shortcirc_done.36 - -shortcirc_done.36: ; preds = %label.13, %shortcirc_next.36 - br bool false, label %fail, label %endif.40 - +shortcirc_done.36: ; preds = %loopentry.1 + br i1 false, label %fail, label %endif.40 endif.40: ; preds = %shortcirc_done.36 br label %loopexit.20 - -loopentry.20: ; preds = %shortcirc_done.40, %endif.46 +loopentry.20: ; preds = %endif.46 br label %loopexit.20 - -loopexit.20: ; preds = %loopentry.20 +loopexit.20: ; preds = %loopentry.20, %endif.40 br label %loopentry.21 - -loopentry.21: ; preds = %loopexit.20, %no_exit.19 - br bool false, label %no_exit.19, label %loopexit.21 - +loopentry.21: ; preds = %no_exit.19, %loopexit.20 + br i1 false, label %no_exit.19, label %loopexit.21 no_exit.19: ; preds = %loopentry.21 - br bool false, label %fail, label %loopentry.21 - + br i1 false, label %fail, label %loopentry.21 loopexit.21: ; preds = %loopentry.21 br label %endif.45 - endif.45: ; preds = %loopexit.21 br label %cond_true.15 - cond_true.15: ; preds = %endif.45 - br bool false, label %fail, label %endif.46 - + br i1 false, label %fail, label %endif.46 endif.46: ; preds = %cond_true.15 br label %loopentry.20 - -fail: ; preds = %shortcirc_done.36, %loopexit.37, %cond_true.15, %no_exit.19 +fail: ; preds = %loopexit.37, %cond_true.15, %no_exit.19, %shortcirc_done.36 br label %then.80 - then.80: ; preds = %fail br label %endif.81 - endif.81: ; preds = %then.80 br label %loopexit.37 - loopexit.37: ; preds = %endif.81 - br bool false, label %fail, label %endif.82 - + br i1 false, label %fail, label %endif.82 endif.82: ; preds = %loopexit.37 br label %loopentry.1 } + + diff --git a/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll b/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll index 59f49e3..53fc59e 100644 --- a/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll +++ b/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll @@ -1,65 +1,52 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -tailduplicate -instcombine -simplifycfg -licm -disable-output - -target endian = little -target pointersize = 32 -%yy_base = external global [787 x short] ; <[787 x short]*> [#uses=1] -%yy_state_ptr = external global int* ; <int**> [#uses=3] -%yy_state_buf = external global [16386 x int] ; <[16386 x int]*> [#uses=1] -%yy_lp = external global int ; <int*> [#uses=1] - -implementation ; Functions: - -int %_yylex() { ; No predecessors! +; RUN: llvm-as < %s | opt -tailduplicate -instcombine -simplifycfg -licm -disable-output +target datalayout = "e-p:32:32" +@yy_base = external global [787 x i16] ; <[787 x i16]*> [#uses=1] +@yy_state_ptr = external global i32* ; <i32**> [#uses=3] +@yy_state_buf = external global [16386 x i32] ; <[16386 x i32]*> [#uses=1] +@yy_lp = external global i32 ; <i32*> [#uses=1] + +define i32 @_yylex() { br label %loopentry.0 - -loopentry.0: ; preds = %0, %else.26 - store int* getelementptr ([16386 x int]* %yy_state_buf, long 0, long 0), int** %yy_state_ptr - %tmp.35 = load int** %yy_state_ptr ; <int*> [#uses=2] - %inc.0 = getelementptr int* %tmp.35, long 1 ; <int*> [#uses=1] - store int* %inc.0, int** %yy_state_ptr - %tmp.36 = load int* null ; <int> [#uses=1] - store int %tmp.36, int* %tmp.35 +loopentry.0: ; preds = %else.26, %0 + store i32* getelementptr ([16386 x i32]* @yy_state_buf, i64 0, i64 0), i32** @yy_state_ptr + %tmp.35 = load i32** @yy_state_ptr ; <i32*> [#uses=2] + %inc.0 = getelementptr i32* %tmp.35, i64 1 ; <i32*> [#uses=1] + store i32* %inc.0, i32** @yy_state_ptr + %tmp.36 = load i32* null ; <i32> [#uses=1] + store i32 %tmp.36, i32* %tmp.35 br label %loopexit.2 - -loopexit.2: ; preds = %loopentry.0, %else.26, %loopexit.2 - store sbyte* null, sbyte** null - %tmp.91 = load int* null ; <int> [#uses=1] - %tmp.92 = cast int %tmp.91 to long ; <long> [#uses=1] - %tmp.93 = getelementptr [787 x short]* %yy_base, long 0, long %tmp.92 ; <short*> [#uses=1] - %tmp.94 = load short* %tmp.93 ; <short> [#uses=1] - %tmp.95 = setne short %tmp.94, 4394 ; <bool> [#uses=1] - br bool %tmp.95, label %loopexit.2, label %yy_find_action - -yy_find_action: ; preds = %loopexit.2, %else.26 +loopexit.2: ; preds = %else.26, %loopexit.2, %loopentry.0 + store i8* null, i8** null + %tmp.91 = load i32* null ; <i32> [#uses=1] + %tmp.92 = sext i32 %tmp.91 to i64 ; <i64> [#uses=1] + %tmp.93 = getelementptr [787 x i16]* @yy_base, i64 0, i64 %tmp.92 ; <i16*> [#uses=1] + %tmp.94 = load i16* %tmp.93 ; <i16> [#uses=1] + %tmp.95 = icmp ne i16 %tmp.94, 4394 ; <i1> [#uses=1] + br i1 %tmp.95, label %loopexit.2, label %yy_find_action +yy_find_action: ; preds = %else.26, %loopexit.2 br label %loopentry.3 - -loopentry.3: ; preds = %yy_find_action, %shortcirc_done.0, %then.9 - %tmp.105 = load int* %yy_lp ; <int> [#uses=1] - %tmp.106 = setne int %tmp.105, 0 ; <bool> [#uses=1] - br bool %tmp.106, label %shortcirc_next.0, label %shortcirc_done.0 - +loopentry.3: ; preds = %then.9, %shortcirc_done.0, %yy_find_action + %tmp.105 = load i32* @yy_lp ; <i32> [#uses=1] + %tmp.106 = icmp ne i32 %tmp.105, 0 ; <i1> [#uses=1] + br i1 %tmp.106, label %shortcirc_next.0, label %shortcirc_done.0 shortcirc_next.0: ; preds = %loopentry.3 - %tmp.114 = load short* null ; <short> [#uses=1] - %tmp.115 = cast short %tmp.114 to int ; <int> [#uses=1] - %tmp.116 = setlt int 0, %tmp.115 ; <bool> [#uses=1] + %tmp.114 = load i16* null ; <i16> [#uses=1] + %tmp.115 = sext i16 %tmp.114 to i32 ; <i32> [#uses=1] + %tmp.116 = icmp slt i32 0, %tmp.115 ; <i1> [#uses=1] br label %shortcirc_done.0 - -shortcirc_done.0: ; preds = %loopentry.3, %shortcirc_next.0 - %shortcirc_val.0 = phi bool [ false, %loopentry.3 ], [ %tmp.116, %shortcirc_next.0 ] ; <bool> [#uses=1] - br bool %shortcirc_val.0, label %else.0, label %loopentry.3 - +shortcirc_done.0: ; preds = %shortcirc_next.0, %loopentry.3 + %shortcirc_val.0 = phi i1 [ false, %loopentry.3 ], [ %tmp.116, %shortcirc_next.0 ] ; <i1> [#uses=1] + br i1 %shortcirc_val.0, label %else.0, label %loopentry.3 else.0: ; preds = %shortcirc_done.0 - %tmp.144 = load int* null ; <int> [#uses=1] - %tmp.145 = and int %tmp.144, 8192 ; <int> [#uses=1] - %tmp.146 = setne int %tmp.145, 0 ; <bool> [#uses=1] - br bool %tmp.146, label %then.9, label %else.26 - + %tmp.144 = load i32* null ; <i32> [#uses=1] + %tmp.145 = and i32 %tmp.144, 8192 ; <i32> [#uses=1] + %tmp.146 = icmp ne i32 %tmp.145, 0 ; <i1> [#uses=1] + br i1 %tmp.146, label %then.9, label %else.26 then.9: ; preds = %else.0 br label %loopentry.3 - -else.26: ; preds = %else.1 - switch uint 0, label %loopentry.0 [ - uint 2, label %yy_find_action - uint 0, label %loopexit.2 +else.26: ; preds = %else.0 + switch i32 0, label %loopentry.0 [ + i32 2, label %yy_find_action + i32 0, label %loopexit.2 ] } diff --git a/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll b/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll index e47112b..bd39330 100644 --- a/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll +++ b/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll @@ -4,39 +4,33 @@ ; ; This is distilled from a monsterous crafty example. -; RUN: llvm-upgrade < %s | llvm-as | opt -licm -disable-output +; RUN: llvm-as < %s | opt -licm -disable-output -%G = weak global int 0 ; <int*> [#uses=13] -implementation ; Functions: +@G = weak global i32 0 ; <i32*> [#uses=7] -int %main() { +define i32 @main() { entry: - store int 123, int* %G + store i32 123, i32* @G br label %loopentry.i - -loopentry.i: ; preds = %entry, %endif.1.i - %tmp.0.i = load int* %G ; <int> [#uses=1] - %tmp.1.i = seteq int %tmp.0.i, 123 ; <bool> [#uses=1] - br bool %tmp.1.i, label %Out.i, label %endif.0.i - +loopentry.i: ; preds = %endif.1.i, %entry + %tmp.0.i = load i32* @G ; <i32> [#uses=1] + %tmp.1.i = icmp eq i32 %tmp.0.i, 123 ; <i1> [#uses=1] + br i1 %tmp.1.i, label %Out.i, label %endif.0.i endif.0.i: ; preds = %loopentry.i - %tmp.3.i = load int* %G ; <int> [#uses=1] - %tmp.4.i = seteq int %tmp.3.i, 126 ; <bool> [#uses=1] - br bool %tmp.4.i, label %ExitBlock.i, label %endif.1.i - + %tmp.3.i = load i32* @G ; <i32> [#uses=1] + %tmp.4.i = icmp eq i32 %tmp.3.i, 126 ; <i1> [#uses=1] + br i1 %tmp.4.i, label %ExitBlock.i, label %endif.1.i endif.1.i: ; preds = %endif.0.i - %tmp.6.i = load int* %G ; <int> [#uses=1] - %inc.i = add int %tmp.6.i, 1 ; <int> [#uses=1] - store int %inc.i, int* %G + %tmp.6.i = load i32* @G ; <i32> [#uses=1] + %inc.i = add i32 %tmp.6.i, 1 ; <i32> [#uses=1] + store i32 %inc.i, i32* @G br label %loopentry.i - Out.i: ; preds = %loopentry.i - store int 0, int* %G + store i32 0, i32* @G br label %ExitBlock.i - -ExitBlock.i: ; preds = %endif.0.i, %Out.i - %tmp.7.i = load int* %G ; <int> [#uses=1] - ret int %tmp.7.i +ExitBlock.i: ; preds = %Out.i, %endif.0.i + %tmp.7.i = load i32* @G ; <i32> [#uses=1] + ret i32 %tmp.7.i } diff --git a/test/Transforms/LoopSimplify/2004-02-05-DominatorInfoCorruption.ll b/test/Transforms/LoopSimplify/2004-02-05-DominatorInfoCorruption.ll index f25460e..b8ced96 100644 --- a/test/Transforms/LoopSimplify/2004-02-05-DominatorInfoCorruption.ll +++ b/test/Transforms/LoopSimplify/2004-02-05-DominatorInfoCorruption.ll @@ -1,17 +1,14 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -loopsimplify -verify -licm -disable-output -implementation ; Functions: +; RUN: llvm-as < %s | opt -loopsimplify -verify -licm -disable-output -void %.subst_48() { +define void @.subst_48() { entry: br label %loopentry.0 - -loopentry.0: ; preds = %entry, %loopentry.0 - br bool false, label %loopentry.0, label %loopentry.2 - -loopentry.2: ; preds = %loopentry.0, %loopentry.2 - %tmp.968 = setle int 0, 3 ; <bool> [#uses=1] - br bool %tmp.968, label %loopentry.2, label %UnifiedReturnBlock - -UnifiedReturnBlock: ; preds = %entry, %loopentry.2 - ret void +loopentry.0: ; preds = %loopentry.0, %entry + br i1 false, label %loopentry.0, label %loopentry.2 +loopentry.2: ; preds = %loopentry.2, %loopentry.0 + %tmp.968 = icmp sle i32 0, 3 ; <i1> [#uses=1] + br i1 %tmp.968, label %loopentry.2, label %UnifiedReturnBlock +UnifiedReturnBlock: ; preds = %loopentry.2 + ret void } + diff --git a/test/Transforms/LoopSimplify/2004-03-15-IncorrectDomUpdate.ll b/test/Transforms/LoopSimplify/2004-03-15-IncorrectDomUpdate.ll index 607f1fe..439ea7e 100644 --- a/test/Transforms/LoopSimplify/2004-03-15-IncorrectDomUpdate.ll +++ b/test/Transforms/LoopSimplify/2004-03-15-IncorrectDomUpdate.ll @@ -1,12 +1,11 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -loopsimplify -licm -disable-output -void %main() { +; RUN: llvm-as < %s | opt -loopsimplify -licm -disable-output +define void @main() { entry: - br bool false, label %Out, label %loop - -loop: - %LI = setgt int 0, 0 - br bool %LI, label %loop, label %Out - -Out: + br i1 false, label %Out, label %loop +loop: ; preds = %loop, %entry + %LI = icmp sgt i32 0, 0 ; <i1> [#uses=1] + br i1 %LI, label %loop, label %Out +Out: ; preds = %loop, %entry ret void } + diff --git a/test/Transforms/LoopSimplify/2004-04-01-IncorrectDomUpdate.ll b/test/Transforms/LoopSimplify/2004-04-01-IncorrectDomUpdate.ll index b984313..e75b214 100644 --- a/test/Transforms/LoopSimplify/2004-04-01-IncorrectDomUpdate.ll +++ b/test/Transforms/LoopSimplify/2004-04-01-IncorrectDomUpdate.ll @@ -1,24 +1,20 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -loopsimplify -licm -disable-output +; RUN: llvm-as < %s | opt -loopsimplify -licm -disable-output ; This is PR306 -void %NormalizeCoeffsVecFFE() { +define void @NormalizeCoeffsVecFFE() { entry: - br label %loopentry.0 - -loopentry.0: ; preds = %entry, %no_exit.0 - br bool false, label %loopentry.1, label %no_exit.0 - -no_exit.0: ; preds = %loopentry.0 - br bool false, label %loopentry.0, label %loopentry.1 - -loopentry.1: ; preds = %loopentry.0, %no_exit.0, %no_exit.1 - br bool false, label %no_exit.1, label %loopexit.1 - -no_exit.1: ; preds = %loopentry.1 - %tmp.43 = seteq ushort 0, 0 ; <bool> [#uses=1] - br bool %tmp.43, label %loopentry.1, label %loopexit.1 - -loopexit.1: ; preds = %loopentry.1, %no_exit.1 - ret void + br label %loopentry.0 +loopentry.0: ; preds = %no_exit.0, %entry + br i1 false, label %loopentry.1, label %no_exit.0 +no_exit.0: ; preds = %loopentry.0 + br i1 false, label %loopentry.0, label %loopentry.1 +loopentry.1: ; preds = %no_exit.1, %no_exit.0, %loopentry.0 + br i1 false, label %no_exit.1, label %loopexit.1 +no_exit.1: ; preds = %loopentry.1 + %tmp.43 = icmp eq i16 0, 0 ; <i1> [#uses=1] + br i1 %tmp.43, label %loopentry.1, label %loopexit.1 +loopexit.1: ; preds = %no_exit.1, %loopentry.1 + ret void } + diff --git a/test/Transforms/LoopSimplify/2004-04-12-LoopSimplify-SwitchBackedges.ll b/test/Transforms/LoopSimplify/2004-04-12-LoopSimplify-SwitchBackedges.ll index 12250b7..ae11d80 100644 --- a/test/Transforms/LoopSimplify/2004-04-12-LoopSimplify-SwitchBackedges.ll +++ b/test/Transforms/LoopSimplify/2004-04-12-LoopSimplify-SwitchBackedges.ll @@ -1,22 +1,18 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -loopsimplify -disable-output +; RUN: llvm-as < %s | opt -loopsimplify -disable-output -implementation - -void %test() { +define void @test() { loopentry.0: br label %loopentry.1 - -loopentry.1: - %pixel.4 = phi int [ 0, %loopentry.0 ], [ %pixel.4, %loopentry.1], [ %tmp.370, %then.6 ], [ %tmp.370, %then.6 ] - br bool false, label %then.6, label %loopentry.1 - -then.6: - %tmp.370 = add int 0, 0 ; <int> [#uses=2] - switch uint 0, label %label.7 [ - uint 6408, label %loopentry.1 - uint 32841, label %loopentry.1 +loopentry.1: ; preds = %then.6, %then.6, %loopentry.1, %loopentry.0 + %pixel.4 = phi i32 [ 0, %loopentry.0 ], [ %pixel.4, %loopentry.1 ], [ %tmp.370, %then.6 ], [ %tmp.370, %then.6 ] ; <i32> [#uses=1] + br i1 false, label %then.6, label %loopentry.1 +then.6: ; preds = %loopentry.1 + %tmp.370 = add i32 0, 0 ; <i32> [#uses=2] + switch i32 0, label %label.7 [ + i32 6408, label %loopentry.1 + i32 32841, label %loopentry.1 ] - label.7: ; preds = %then.6 ret void } + diff --git a/test/Transforms/LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll b/test/Transforms/LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll index 7f16400..427631c 100644 --- a/test/Transforms/LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll +++ b/test/Transforms/LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll @@ -1,22 +1,18 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl -loopsimplify -licm -disable-output +; RUN: llvm-as < %s | opt -scalarrepl -loopsimplify -licm -disable-output -implementation ; Functions: - -void %inflate() { +define void @inflate() { entry: br label %loopentry.0.outer1111 - -loopentry.0.outer1111: ; preds = %entry, %loopentry.0.outer1111, %label.11, %then.41 - %left.0.ph1107 = phi uint [ %tmp.1172, %then.41 ], [ 0, %entry ], [ %tmp.1172, %label.11 ], [ %left.0.ph1107, %loopentry.0.outer1111 ] ; <uint> [#uses=2] - %tmp.1172 = sub uint %left.0.ph1107, 0 ; <uint> [#uses=2] - switch uint 0, label %label.11 [ - uint 23, label %loopentry.0.outer1111 - uint 13, label %then.41 +loopentry.0.outer1111: ; preds = %then.41, %label.11, %loopentry.0.outer1111, %entry + %left.0.ph1107 = phi i32 [ %tmp.1172, %then.41 ], [ 0, %entry ], [ %tmp.1172, %label.11 ], [ %left.0.ph1107, %loopentry.0.outer1111 ] ; <i32> [#uses=2] + %tmp.1172 = sub i32 %left.0.ph1107, 0 ; <i32> [#uses=2] + switch i32 0, label %label.11 [ + i32 23, label %loopentry.0.outer1111 + i32 13, label %then.41 ] - label.11: ; preds = %loopentry.0.outer1111 br label %loopentry.0.outer1111 - then.41: ; preds = %loopentry.0.outer1111 br label %loopentry.0.outer1111 } + diff --git a/test/Transforms/LoopSimplify/basictest.ll b/test/Transforms/LoopSimplify/basictest.ll index 2b01b47..0388b0e 100644 --- a/test/Transforms/LoopSimplify/basictest.ll +++ b/test/Transforms/LoopSimplify/basictest.ll @@ -1,17 +1,16 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -loopsimplify - -implementation +; RUN: llvm-as < %s | opt -loopsimplify ; This function should get a preheader inserted before BB3, that is jumped ; to by BB1 & BB2 ; -void "test"() -begin - br bool true, label %BB1, label %BB2 -BB1: br label %BB3 -BB2: br label %BB3 - -BB3: +define void @test() { + br i1 true, label %BB1, label %BB2 +BB1: ; preds = %0 + br label %BB3 +BB2: ; preds = %0 br label %BB3 -end +BB3: ; preds = %BB3, %BB2, %BB1 + br label %BB3 +} + diff --git a/test/Transforms/LoopSimplify/hardertest.ll b/test/Transforms/LoopSimplify/hardertest.ll index a4465b7..6ee0567 100644 --- a/test/Transforms/LoopSimplify/hardertest.ll +++ b/test/Transforms/LoopSimplify/hardertest.ll @@ -1,17 +1,15 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -loopsimplify +; RUN: llvm-as < %s | opt -loopsimplify -void %foo(bool %C) { - br bool %C, label %T, label %F -T: +define void @foo(i1 %C) { + br i1 %C, label %T, label %F +T: ; preds = %0 br label %Loop -F: +F: ; preds = %0 br label %Loop - -Loop: ; Two backedges, two incoming edges. - %Val = phi int [0, %T], [1, %F], [2, %Loop], [3, %L2] - - br bool %C, label %Loop, label %L2 - -L2: +Loop: ; preds = %L2, %Loop, %F, %T + %Val = phi i32 [ 0, %T ], [ 1, %F ], [ 2, %Loop ], [ 3, %L2 ] ; <i32> [#uses=0] + br i1 %C, label %Loop, label %L2 +L2: ; preds = %Loop br label %Loop } + diff --git a/test/Transforms/LoopSimplify/phi-node-simplify.ll b/test/Transforms/LoopSimplify/phi-node-simplify.ll index 9427b7a..a22fadb 100644 --- a/test/Transforms/LoopSimplify/phi-node-simplify.ll +++ b/test/Transforms/LoopSimplify/phi-node-simplify.ll @@ -1,59 +1,55 @@ ; Loop Simplify should turn phi nodes like X = phi [X, Y] into just Y, eliminating them. -; RUN: llvm-upgrade < %s | llvm-as | opt -loopsimplify | llvm-dis | grep phi | count 6 +; RUN: llvm-as < %s | opt -loopsimplify | llvm-dis | grep phi | count 6 -%A = weak global [3000000 x int] zeroinitializer ; <[3000000 x int]*> [#uses=1] -%B = weak global [20000 x int] zeroinitializer ; <[20000 x int]*> [#uses=1] -%C = weak global [100 x int] zeroinitializer ; <[100 x int]*> [#uses=1] -%Z = weak global int 0 ; <int*> [#uses=2] +@A = weak global [3000000 x i32] zeroinitializer ; <[3000000 x i32]*> [#uses=1] +@B = weak global [20000 x i32] zeroinitializer ; <[20000 x i32]*> [#uses=1] +@C = weak global [100 x i32] zeroinitializer ; <[100 x i32]*> [#uses=1] +@Z = weak global i32 0 ; <i32*> [#uses=2] -implementation ; Functions: - -int %main() { +define i32 @main() { entry: - tail call void %__main( ) + tail call void @__main( ) br label %loopentry.1 - loopentry.1: ; preds = %loopexit.1, %entry - %indvar20 = phi uint [ 0, %entry ], [ %indvar.next21, %loopexit.1 ] ; <uint> [#uses=1] - %a.1 = phi int* [ getelementptr ([3000000 x int]* %A, int 0, int 0), %entry ], [ %inc.0, %loopexit.1 ] ; <int*> [#uses=1] + %indvar20 = phi i32 [ 0, %entry ], [ %indvar.next21, %loopexit.1 ] ; <i32> [#uses=1] + %a.1 = phi i32* [ getelementptr ([3000000 x i32]* @A, i32 0, i32 0), %entry ], [ %inc.0, %loopexit.1 ] ; <i32*> [#uses=1] br label %no_exit.2 - no_exit.2: ; preds = %loopexit.2, %no_exit.2, %loopentry.1 - %a.0.4.ph = phi int* [ %a.1, %loopentry.1 ], [ %inc.0, %loopexit.2 ], [ %a.0.4.ph, %no_exit.2 ] ; <int*> [#uses=3] - %b.1.4.ph = phi int* [ getelementptr ([20000 x int]* %B, int 0, int 0), %loopentry.1 ], [ %inc.1, %loopexit.2 ], [ %b.1.4.ph, %no_exit.2 ] ; <int*> [#uses=3] - %indvar17 = phi uint [ 0, %loopentry.1 ], [ %indvar.next18, %loopexit.2 ], [ %indvar17, %no_exit.2 ] ; <uint> [#uses=2] - %indvar = phi uint [ %indvar.next, %no_exit.2 ], [ 0, %loopexit.2 ], [ 0, %loopentry.1 ] ; <uint> [#uses=5] - %b.1.4.rec = cast uint %indvar to int ; <int> [#uses=1] - %c.2.4 = getelementptr [100 x int]* %C, int 0, uint %indvar ; <int*> [#uses=1] - %a.0.4 = getelementptr int* %a.0.4.ph, uint %indvar ; <int*> [#uses=1] - %b.1.4 = getelementptr int* %b.1.4.ph, uint %indvar ; <int*> [#uses=1] - %inc.0.rec = add int %b.1.4.rec, 1 ; <int> [#uses=2] - %inc.0 = getelementptr int* %a.0.4.ph, int %inc.0.rec ; <int*> [#uses=2] - %tmp.13 = load int* %a.0.4 ; <int> [#uses=1] - %inc.1 = getelementptr int* %b.1.4.ph, int %inc.0.rec ; <int*> [#uses=1] - %tmp.15 = load int* %b.1.4 ; <int> [#uses=1] - %tmp.18 = load int* %c.2.4 ; <int> [#uses=1] - %tmp.16 = mul int %tmp.15, %tmp.13 ; <int> [#uses=1] - %tmp.19 = mul int %tmp.16, %tmp.18 ; <int> [#uses=1] - %tmp.20 = load int* %Z ; <int> [#uses=1] - %tmp.21 = add int %tmp.19, %tmp.20 ; <int> [#uses=1] - store int %tmp.21, int* %Z - %indvar.next = add uint %indvar, 1 ; <uint> [#uses=2] - %exitcond = seteq uint %indvar.next, 100 ; <bool> [#uses=1] - br bool %exitcond, label %loopexit.2, label %no_exit.2 - + %a.0.4.ph = phi i32* [ %a.1, %loopentry.1 ], [ %inc.0, %loopexit.2 ], [ %a.0.4.ph, %no_exit.2 ] ; <i32*> [#uses=3] + %b.1.4.ph = phi i32* [ getelementptr ([20000 x i32]* @B, i32 0, i32 0), %loopentry.1 ], [ %inc.1, %loopexit.2 ], [ %b.1.4.ph, %no_exit.2 ] ; <i32*> [#uses=3] + %indvar17 = phi i32 [ 0, %loopentry.1 ], [ %indvar.next18, %loopexit.2 ], [ %indvar17, %no_exit.2 ] ; <i32> [#uses=2] + %indvar = phi i32 [ %indvar.next, %no_exit.2 ], [ 0, %loopexit.2 ], [ 0, %loopentry.1 ] ; <i32> [#uses=5] + %b.1.4.rec = bitcast i32 %indvar to i32 ; <i32> [#uses=1] + %gep.upgrd.1 = zext i32 %indvar to i64 ; <i64> [#uses=1] + %c.2.4 = getelementptr [100 x i32]* @C, i32 0, i64 %gep.upgrd.1 ; <i32*> [#uses=1] + %gep.upgrd.2 = zext i32 %indvar to i64 ; <i64> [#uses=1] + %a.0.4 = getelementptr i32* %a.0.4.ph, i64 %gep.upgrd.2 ; <i32*> [#uses=1] + %gep.upgrd.3 = zext i32 %indvar to i64 ; <i64> [#uses=1] + %b.1.4 = getelementptr i32* %b.1.4.ph, i64 %gep.upgrd.3 ; <i32*> [#uses=1] + %inc.0.rec = add i32 %b.1.4.rec, 1 ; <i32> [#uses=2] + %inc.0 = getelementptr i32* %a.0.4.ph, i32 %inc.0.rec ; <i32*> [#uses=2] + %tmp.13 = load i32* %a.0.4 ; <i32> [#uses=1] + %inc.1 = getelementptr i32* %b.1.4.ph, i32 %inc.0.rec ; <i32*> [#uses=1] + %tmp.15 = load i32* %b.1.4 ; <i32> [#uses=1] + %tmp.18 = load i32* %c.2.4 ; <i32> [#uses=1] + %tmp.16 = mul i32 %tmp.15, %tmp.13 ; <i32> [#uses=1] + %tmp.19 = mul i32 %tmp.16, %tmp.18 ; <i32> [#uses=1] + %tmp.20 = load i32* @Z ; <i32> [#uses=1] + %tmp.21 = add i32 %tmp.19, %tmp.20 ; <i32> [#uses=1] + store i32 %tmp.21, i32* @Z + %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=2] + %exitcond = icmp eq i32 %indvar.next, 100 ; <i1> [#uses=1] + br i1 %exitcond, label %loopexit.2, label %no_exit.2 loopexit.2: ; preds = %no_exit.2 - %indvar.next18 = add uint %indvar17, 1 ; <uint> [#uses=2] - %exitcond19 = seteq uint %indvar.next18, 200 ; <bool> [#uses=1] - br bool %exitcond19, label %loopexit.1, label %no_exit.2 - + %indvar.next18 = add i32 %indvar17, 1 ; <i32> [#uses=2] + %exitcond19 = icmp eq i32 %indvar.next18, 200 ; <i1> [#uses=1] + br i1 %exitcond19, label %loopexit.1, label %no_exit.2 loopexit.1: ; preds = %loopexit.2 - %indvar.next21 = add uint %indvar20, 1 ; <uint> [#uses=2] - %exitcond22 = seteq uint %indvar.next21, 300 ; <bool> [#uses=1] - br bool %exitcond22, label %return, label %loopentry.1 - + %indvar.next21 = add i32 %indvar20, 1 ; <i32> [#uses=2] + %exitcond22 = icmp eq i32 %indvar.next21, 300 ; <i1> [#uses=1] + br i1 %exitcond22, label %return, label %loopentry.1 return: ; preds = %loopexit.1 - ret int undef + ret i32 undef } -declare void %__main() +declare void @__main() diff --git a/test/Transforms/LoopSimplify/single-backedge.ll b/test/Transforms/LoopSimplify/single-backedge.ll index 53a6ffb..0c09b9e 100644 --- a/test/Transforms/LoopSimplify/single-backedge.ll +++ b/test/Transforms/LoopSimplify/single-backedge.ll @@ -2,16 +2,18 @@ ; for all loops. This allows the -indvars pass to recognize the %IV ; induction variable in this testcase. -; RUN: llvm-upgrade < %s | llvm-as | opt -indvars | llvm-dis | grep indvar +; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep indvar -int %test(bool %C) { +define i32 @test(i1 %C) { +; <label>:0 br label %Loop -Loop: - %IV = phi uint [1, %0], [%IV2, %BE1], [%IV2, %BE2] - %IV2 = add uint %IV, 2 - br bool %C, label %BE1, label %BE2 -BE1: +Loop: ; preds = %BE2, %BE1, %0 + %IV = phi i32 [ 1, %0 ], [ %IV2, %BE1 ], [ %IV2, %BE2 ] ; <i32> [#uses=1] + %IV2 = add i32 %IV, 2 ; <i32> [#uses=2] + br i1 %C, label %BE1, label %BE2 +BE1: ; preds = %Loop br label %Loop -BE2: +BE2: ; preds = %Loop br label %Loop } + |