diff options
| author | Devang Patel <dpatel@apple.com> | 2008-07-09 00:12:01 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2008-07-09 00:12:01 +0000 |
| commit | 51cbf928ab5d77ad4368a01d4e7470dbaa05ae21 (patch) | |
| tree | 356fcf3344392dae7b70f2a3c6236cc6b458468d /llvm/test/Transforms | |
| parent | 919936815ed9b3295b630f3c5821354d118d4cf6 (diff) | |
| download | bcm5719-llvm-51cbf928ab5d77ad4368a01d4e7470dbaa05ae21.tar.gz bcm5719-llvm-51cbf928ab5d77ad4368a01d4e7470dbaa05ae21.zip | |
If loop induction variable's start value is less then its exit value then do not split the loop.
llvm-svn: 53265
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/LoopIndexSplit/2008-05-19-IndVar.ll | 2 | ||||
| -rw-r--r-- | llvm/test/Transforms/LoopIndexSplit/2008-07-08-MisCompilation.ll | 25 |
2 files changed, 26 insertions, 1 deletions
diff --git a/llvm/test/Transforms/LoopIndexSplit/2008-05-19-IndVar.ll b/llvm/test/Transforms/LoopIndexSplit/2008-05-19-IndVar.ll index 8aa2e52b3fe..c4678b47ac4 100644 --- a/llvm/test/Transforms/LoopIndexSplit/2008-05-19-IndVar.ll +++ b/llvm/test/Transforms/LoopIndexSplit/2008-05-19-IndVar.ll @@ -24,7 +24,7 @@ bb4.i: ; preds = %bb.i br label %bb6.i bb6.i: ; preds = %bb4.i, %bb.i %tmp8.i = add i16 %g_2.tmp.0.i, 1 ; <i16> [#uses=3] - %tmp11.i = icmp sgt i16 %tmp8.i, 0 ; <i1> [#uses=1] + %tmp11.i = icmp sgt i16 %tmp8.i, 42 ; <i1> [#uses=1] br i1 %tmp11.i, label %bb.i, label %return.loopexit.i return.loopexit.i: ; preds = %bb6.i %tmp8.i.lcssa = phi i16 [ %tmp8.i, %bb6.i ] ; <i16> [#uses=1] diff --git a/llvm/test/Transforms/LoopIndexSplit/2008-07-08-MisCompilation.ll b/llvm/test/Transforms/LoopIndexSplit/2008-07-08-MisCompilation.ll new file mode 100644 index 00000000000..7592511a290 --- /dev/null +++ b/llvm/test/Transforms/LoopIndexSplit/2008-07-08-MisCompilation.ll @@ -0,0 +1,25 @@ +; RUN: llvm-as < %s | opt -loop-index-split -stats -disable-output | not grep "1 loop-index-split" +; PR 2487 +@g_6 = external global i32 ; <i32*> [#uses=1] + +define void @func_1() nounwind { +entry: + br label %bb + +bb: ; preds = %bb4, %entry + %l_3.0 = phi i8 [ 0, %entry ], [ %tmp6, %bb4 ] ; <i8> [#uses=2] + %tmp1 = icmp eq i8 %l_3.0, 0 ; <i1> [#uses=1] + br i1 %tmp1, label %bb3, label %bb4 + +bb3: ; preds = %bb + store i32 1, i32* @g_6, align 4 + br label %bb4 + +bb4: ; preds = %bb3, %bb + %tmp6 = add i8 %l_3.0, 1 ; <i8> [#uses=2] + %tmp9 = icmp sgt i8 %tmp6, -1 ; <i1> [#uses=1] + br i1 %tmp9, label %bb, label %return + +return: ; preds = %bb4 + ret void +} |

