diff options
| author | Dan Gohman <gohman@apple.com> | 2010-08-17 17:39:21 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-08-17 17:39:21 +0000 |
| commit | a932bae406dcddd6e4e39f8253ca721559a9dffb (patch) | |
| tree | bb782c7be300cfbfc1d5a8d82b003fb4f7460271 /test/Transforms/LoopRotate/phi-duplicate.ll | |
| parent | beaa774c74e92040e81695c71f22b88fea6efb32 (diff) | |
| download | external_llvm-a932bae406dcddd6e4e39f8253ca721559a9dffb.zip external_llvm-a932bae406dcddd6e4e39f8253ca721559a9dffb.tar.gz external_llvm-a932bae406dcddd6e4e39f8253ca721559a9dffb.tar.bz2 | |
When rotating loops, put the original header at the bottom of the
loop, making the resulting loop significantly less ugly. Also, zap
its trivial PHI nodes, since it's easy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111255 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LoopRotate/phi-duplicate.ll')
| -rw-r--r-- | test/Transforms/LoopRotate/phi-duplicate.ll | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/test/Transforms/LoopRotate/phi-duplicate.ll b/test/Transforms/LoopRotate/phi-duplicate.ll index 9a64e2a..5403e72 100644 --- a/test/Transforms/LoopRotate/phi-duplicate.ll +++ b/test/Transforms/LoopRotate/phi-duplicate.ll @@ -27,9 +27,21 @@ for.body: ; preds = %for.cond for.end: ; preds = %for.cond ret void } -; Should only end up with one phi. -; CHECK: for.body: -; CHECK-NEXT: %j.02 = phi i64 -; CHECK-NOT: phi -; CHECK: ret void +; Should only end up with one phi. Also, the original for.cond block should +; be moved to the end of the loop so that the new loop header pleasantly +; ends up at the top. + +; CHECK: define void @test +; CHECK-NEXT: entry: +; CHECK-NEXT: icmp slt i64 +; CHECK-NEXT: br i1 +; CHECK-NOT: : +; CHECK: bb.nph: +; CHECK-NEXT: br label %for.body +; CHECK-NOT: : +; CHECK: for.body: +; CHECK-NEXT: %j.02 = phi i64 +; CHECK-NOT: phi +; CHECK: ret void +; CHECK-NEXT: } |
