diff options
Diffstat (limited to 'test/Analysis/ScalarEvolution/trip-count-pow2.ll')
-rw-r--r-- | test/Analysis/ScalarEvolution/trip-count-pow2.ll | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/test/Analysis/ScalarEvolution/trip-count-pow2.ll b/test/Analysis/ScalarEvolution/trip-count-pow2.ll index 2c5b72e49daf4..8d053060b50c0 100644 --- a/test/Analysis/ScalarEvolution/trip-count-pow2.ll +++ b/test/Analysis/ScalarEvolution/trip-count-pow2.ll @@ -48,6 +48,40 @@ exit: ret void ; CHECK-LABEL: @test3 -; CHECK: Loop %loop: Unpredictable backedge-taken count. -; CHECK: Loop %loop: Unpredictable max backedge-taken count. +; CHECK: Loop %loop: backedge-taken count is ((-32 + (32 * %n)) /u 32) +; CHECK: Loop %loop: max backedge-taken count is ((-32 + (32 * %n)) /u 32) +} + +define void @test4(i32 %n) { +entry: + %s = mul i32 %n, 4 + br label %loop +loop: + %i = phi i32 [ 0, %entry ], [ %i.next, %loop ] + %i.next = add i32 %i, 12 + %t = icmp ne i32 %i.next, %s + br i1 %t, label %loop, label %exit +exit: + ret void + +; CHECK-LABEL: @test4 +; CHECK: Loop %loop: backedge-taken count is ((-4 + (-1431655764 * %n)) /u 4) +; CHECK: Loop %loop: max backedge-taken count is ((-4 + (-1431655764 * %n)) /u 4) +} + +define void @test5(i32 %n) { +entry: + %s = mul i32 %n, 4 + br label %loop +loop: + %i = phi i32 [ %s, %entry ], [ %i.next, %loop ] + %i.next = add i32 %i, -4 + %t = icmp ne i32 %i.next, 0 + br i1 %t, label %loop, label %exit +exit: + ret void + +; CHECK-LABEL: @test5 +; CHECK: Loop %loop: backedge-taken count is ((-4 + (4 * %n)) /u 4) +; CHECK: Loop %loop: max backedge-taken count is ((-4 + (4 * %n)) /u 4) } |