1 ; RUN: opt < %s -scalar-evolution -analyze | FileCheck %s
3 define void @test1(i32 %n) {
8 %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
9 %i.next = add i32 %i, 32
10 %t = icmp ne i32 %i.next, %s
11 br i1 %t, label %loop, label %exit
16 ; CHECK: Loop %loop: backedge-taken count is ((-32 + (96 * %n)) /u 32)
17 ; CHECK: Loop %loop: max backedge-taken count is ((-32 + (96 * %n)) /u 32)
21 define i32 @test2(i32 %n) {
26 %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
27 %i.next = add i32 %i, 32
28 %t = icmp ne i32 %i.next, %s
29 br i1 %t, label %loop, label %exit
34 ; CHECK: Loop %loop: backedge-taken count is ((-32 + (32 * (%n /u 32))) /u 32)
35 ; CHECK: Loop %loop: max backedge-taken count is ((-32 + (32 * (%n /u 32))) /u 32)
38 define void @test3(i32 %n) {
43 %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
44 %i.next = add i32 %i, 96
45 %t = icmp ne i32 %i.next, %s
46 br i1 %t, label %loop, label %exit
51 ; CHECK: Loop %loop: Unpredictable backedge-taken count.
52 ; CHECK: Loop %loop: Unpredictable max backedge-taken count.