summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopRotate/phi-duplicate.ll
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-08-17 17:39:21 +0000
committerDan Gohman <gohman@apple.com>2010-08-17 17:39:21 +0000
commit5047ca0c02a3d35797413ac8a5651a6ee9537f15 (patch)
tree86ee6fb8748b856e298fb39bd89dd2382ed8655f /llvm/test/Transforms/LoopRotate/phi-duplicate.ll
parenta92773660485af9faea69911de59a0f99e8e9561 (diff)
downloadbcm5719-llvm-5047ca0c02a3d35797413ac8a5651a6ee9537f15.tar.gz
bcm5719-llvm-5047ca0c02a3d35797413ac8a5651a6ee9537f15.zip
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. llvm-svn: 111255
Diffstat (limited to 'llvm/test/Transforms/LoopRotate/phi-duplicate.ll')
-rw-r--r--llvm/test/Transforms/LoopRotate/phi-duplicate.ll22
1 files changed, 17 insertions, 5 deletions
diff --git a/llvm/test/Transforms/LoopRotate/phi-duplicate.ll b/llvm/test/Transforms/LoopRotate/phi-duplicate.ll
index 9a64e2a9a83..5403e723ee1 100644
--- a/llvm/test/Transforms/LoopRotate/phi-duplicate.ll
+++ b/llvm/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: }
OpenPOWER on IntegriCloud