1; RUN: opt -analyze -scalar-evolution < %s | FileCheck %s 2 3define void @f(i1 %c) { 4; CHECK-LABEL: Classifying expressions for: @f 5entry: 6 %start = select i1 %c, i32 100, i32 0 7 %step = select i1 %c, i32 -1, i32 1 8 br label %loop 9 10loop: 11 %iv = phi i32 [ %start, %entry ], [ %iv.dec, %loop ] 12 %iv.tc = phi i32 [ 0, %entry ], [ %iv.tc.inc, %loop ] 13 %iv.tc.inc = add i32 %iv.tc, 1 14 %iv.dec = add nsw i32 %iv, %step 15 %iv.sext = sext i32 %iv to i64 16; CHECK: %iv.sext = sext i32 %iv to i64 17; CHECK-NEXT: --> {(sext i32 %start to i64),+,(sext i32 %step to i64)}<nsw><%loop> 18 %be = icmp ne i32 %iv.tc.inc, 100 19 br i1 %be, label %loop, label %leave 20 21leave: 22 ret void 23} 24