1 ; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s
3 define void @f(ptr %condition) {
4 ; CHECK-LABEL: Classifying expressions for: @f
9 %idx = phi i32 [ 0, %entry ], [ %idx.inc, %loop ]
10 %idx.inc = add nsw i32 %idx, 1
12 %idx.inc2 = add i32 %idx.inc, 1
13 %idx.inc2.zext = zext i32 %idx.inc2 to i64
15 ; CHECK: %idx.inc2.zext = zext i32 %idx.inc2 to i64
16 ; CHECK-NEXT: --> {2,+,1}<nuw><%loop>
18 %c = load volatile i1, ptr %condition
19 br i1 %c, label %loop, label %exit
25 define void @g(ptr %condition) {
26 ; CHECK-LABEL: Classifying expressions for: @g
31 %idx = phi i32 [ 0, %entry ], [ %idx.inc, %loop ]
32 %idx.inc = add nsw i32 %idx, 3
34 %idx.inc2 = add i32 %idx.inc, -1
35 %idx.inc2.sext = sext i32 %idx.inc2 to i64
36 ; CHECK: %idx.inc2.sext = sext i32 %idx.inc2 to i64
37 ; CHECK-NEXT: --> {2,+,3}<nuw><nsw><%loop>
39 %cond.gep = getelementptr inbounds i1, ptr %condition, i32 %idx.inc
40 %c = load volatile i1, ptr %cond.gep
41 br i1 %c, label %loop, label %exit