From 9d4588ffadfdf6c190758200b2ca69742f46d239 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 22 Jun 2010 13:15:46 +0000 Subject: 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 --- test/Analysis/ScalarEvolution/trip-count10.ll | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test/Analysis') diff --git a/test/Analysis/ScalarEvolution/trip-count10.ll b/test/Analysis/ScalarEvolution/trip-count10.ll index 2386cf4..546e1dc 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 +} -- cgit v1.1