1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s
4 define void @x(ptr %cond) {
6 ; CHECK-NEXT: Classifying expressions for: @x
7 ; CHECK-NEXT: %idx = phi i8 [ 0, %entry ], [ %idx.inc, %loop ]
8 ; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,-128) S: [0,-128) Exits: <<Unknown>> LoopDispositions: { %loop: Computable }
9 ; CHECK-NEXT: %idx.inc = add nsw i8 %idx, 1
10 ; CHECK-NEXT: --> {1,+,1}<nuw><%loop> U: [1,0) S: [1,0) Exits: <<Unknown>> LoopDispositions: { %loop: Computable }
11 ; CHECK-NEXT: %c = load volatile i1, ptr %cond, align 1
12 ; CHECK-NEXT: --> %c U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant }
13 ; CHECK-NEXT: Determining loop execution counts for: @x
14 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count.
15 ; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count.
16 ; CHECK-NEXT: Loop %loop: Unpredictable symbolic max backedge-taken count.
17 ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count.
23 %idx = phi i8 [ 0, %entry ], [ %idx.inc, %loop ]
25 %idx.inc = add nsw i8 %idx, 1
27 %c = load volatile i1, ptr %cond
28 br i1 %c, label %loop, label %exit
34 define void @y(ptr %addr) {
36 ; CHECK-NEXT: Classifying expressions for: @y
37 ; CHECK-NEXT: %idx = phi i8 [ -5, %entry ], [ %idx.inc, %loop ]
38 ; CHECK-NEXT: --> {-5,+,1}<nsw><%loop> U: [-5,6) S: [-5,6) Exits: 5 LoopDispositions: { %loop: Computable }
39 ; CHECK-NEXT: %idx.inc = add i8 %idx, 1
40 ; CHECK-NEXT: --> {-4,+,1}<nsw><%loop> U: [-4,7) S: [-4,7) Exits: 6 LoopDispositions: { %loop: Computable }
41 ; CHECK-NEXT: Determining loop execution counts for: @y
42 ; CHECK-NEXT: Loop %loop: backedge-taken count is 10
43 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 10
44 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is 10
45 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is 10
46 ; CHECK-NEXT: Predicates:
47 ; CHECK-NEXT: Loop %loop: Trip multiple is 11
53 %idx = phi i8 [-5, %entry ], [ %idx.inc, %loop ]
55 %idx.inc = add i8 %idx, 1
57 %continue = icmp slt i8 %idx.inc, 6
58 br i1 %continue, label %loop, label %exit