diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-11-17 18:10:11 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-11-17 18:10:11 +0000 |
commit | 076e085698c484354c9e131f1bd8fd001581397b (patch) | |
tree | 61c9b2714cf4017a1e7c3af8462680e47a65ba64 /test | |
parent | 37d60fd1427386f68faeb0217ac2034d1acfe486 (diff) | |
download | external_llvm-076e085698c484354c9e131f1bd8fd001581397b.zip external_llvm-076e085698c484354c9e131f1bd8fd001581397b.tar.gz external_llvm-076e085698c484354c9e131f1bd8fd001581397b.tar.bz2 |
Generalize OptimizeLoopTermCond to optimize more loop terminating icmp to use postinc iv.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89116 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/LoopStrengthReduce/icmp_use_postinc.ll | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/Transforms/LoopStrengthReduce/icmp_use_postinc.ll b/test/Transforms/LoopStrengthReduce/icmp_use_postinc.ll new file mode 100644 index 0000000..4ad5d14 --- /dev/null +++ b/test/Transforms/LoopStrengthReduce/icmp_use_postinc.ll @@ -0,0 +1,27 @@ +; RUN: opt < %s -loop-reduce -S | FileCheck %s + +define i32 @main(i32 %argc, i8** nocapture %argv) nounwind ssp { +entry: + br i1 undef, label %bb4.preheader, label %bb.nph8 + +bb4.preheader: ; preds = %entry + br label %bb4 + +bb1: ; preds = %bb4 + br i1 undef, label %bb.nph8, label %bb3 + +bb3: ; preds = %bb1 + %phitmp = add i32 %indvar, 1 ; <i32> [#uses=1] + br label %bb4 + +bb4: ; preds = %bb3, %bb4.preheader +; CHECK: %lsr.iv = phi +; CHECK: %lsr.iv.next = add i32 %lsr.iv, 1 +; CHECK: %0 = icmp slt i32 %lsr.iv.next, %argc + %indvar = phi i32 [ 1, %bb4.preheader ], [ %phitmp, %bb3 ] ; <i32> [#uses=2] + %0 = icmp slt i32 %indvar, %argc ; <i1> [#uses=1] + br i1 %0, label %bb1, label %bb.nph8 + +bb.nph8: ; preds = %bb4, %bb1, %entry + unreachable +} |