1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt < %s "-passes=print<scalar-evolution>" -scalar-evolution-classify-expressions=0 -disable-output 2>&1 | FileCheck %s
4 define void @test1(i32 %n) {
6 ; CHECK-NEXT: Determining loop execution counts for: @test1
7 ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-32 + (96 * %n)) /u 32)
8 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i32 134217727
9 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is ((-32 + (96 * %n)) /u 32)
10 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
16 %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
17 %i.next = add i32 %i, 32
18 %t = icmp ne i32 %i.next, %s
19 br i1 %t, label %loop, label %exit
26 define i32 @test2(i32 %n) {
27 ; CHECK-LABEL: 'test2'
28 ; CHECK-NEXT: Determining loop execution counts for: @test2
29 ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-32 + (32 * (%n /u 32))<nuw>) /u 32)
30 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i32 134217727
31 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is ((-32 + (32 * (%n /u 32))<nuw>) /u 32)
32 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
38 %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
39 %i.next = add i32 %i, 32
40 %t = icmp ne i32 %i.next, %s
41 br i1 %t, label %loop, label %exit
47 define void @test3(i32 %n) {
48 ; CHECK-LABEL: 'test3'
49 ; CHECK-NEXT: Determining loop execution counts for: @test3
50 ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-32 + (32 * %n)) /u 32)
51 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i32 134217727
52 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is ((-32 + (32 * %n)) /u 32)
53 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
59 %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
60 %i.next = add i32 %i, 96
61 %t = icmp ne i32 %i.next, %s
62 br i1 %t, label %loop, label %exit
68 define void @test4(i32 %n) {
69 ; CHECK-LABEL: 'test4'
70 ; CHECK-NEXT: Determining loop execution counts for: @test4
71 ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-4 + (-1431655764 * %n)) /u 4)
72 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i32 1073741823
73 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is ((-4 + (-1431655764 * %n)) /u 4)
74 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
80 %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
81 %i.next = add i32 %i, 12
82 %t = icmp ne i32 %i.next, %s
83 br i1 %t, label %loop, label %exit
89 define void @test5(i32 %n) {
90 ; CHECK-LABEL: 'test5'
91 ; CHECK-NEXT: Determining loop execution counts for: @test5
92 ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-4 + (4 * %n)) /u 4)
93 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i32 1073741823
94 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is ((-4 + (4 * %n)) /u 4)
95 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
101 %i = phi i32 [ %s, %entry ], [ %i.next, %loop ]
102 %i.next = add i32 %i, -4
103 %t = icmp ne i32 %i.next, 0
104 br i1 %t, label %loop, label %exit