summaryrefslogtreecommitdiff
path: root/test/Analysis/ScalarEvolution
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-06-22 13:15:46 +0000
committerDan Gohman <gohman@apple.com>2010-06-22 13:15:46 +0000
commit9d4588ffadfdf6c190758200b2ca69742f46d239 (patch)
treed71e08e8dc5e82bd914ba0a494da987577fb0b02 /test/Analysis/ScalarEvolution
parente4acff8720b0a92d93613fef1fb47ed701ba71c5 (diff)
downloadllvm-9d4588ffadfdf6c190758200b2ca69742f46d239.tar.gz
llvm-9d4588ffadfdf6c190758200b2ca69742f46d239.tar.bz2
llvm-9d4588ffadfdf6c190758200b2ca69742f46d239.tar.xz
Allow "exhaustive" trip count evaluation on phi nodes with all
constant operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106537 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/ScalarEvolution')
-rw-r--r--test/Analysis/ScalarEvolution/trip-count10.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Analysis/ScalarEvolution/trip-count10.ll b/test/Analysis/ScalarEvolution/trip-count10.ll
index 2386cf4f59..546e1dc7d8 100644
--- a/test/Analysis/ScalarEvolution/trip-count10.ll
+++ b/test/Analysis/ScalarEvolution/trip-count10.ll
@@ -105,3 +105,22 @@ bb2:
retbb:
ret void
}
+
+; PHI nodes with all constant operands.
+
+; CHECK: Determining loop execution counts for: @constant_phi_operands
+; CHECK: Loop %loop: backedge-taken count is 1
+; CHECK: Loop %loop: max backedge-taken count is 1
+
+define void @constant_phi_operands() nounwind {
+entry:
+ br label %loop
+
+loop:
+ %i = phi i64 [ 1, %loop ], [ 0, %entry ]
+ %exitcond = icmp eq i64 %i, 1
+ br i1 %exitcond, label %return, label %loop
+
+return:
+ ret void
+}