1 ; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s 2 ; PR1614 3 4 ; CHECK: smax 5 6 define i32 @f(i32 %x, i32 %y) { 7 entry: 8 br label %bb 9 10 bb: ; preds = %bb, %entry 11 %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb ] ; <i32> [#uses=2] 12 %x_addr.0 = add i32 %indvar, %x ; <i32> [#uses=1] 13 %tmp2 = add i32 %x_addr.0, 1 ; <i32> [#uses=2] 14 %tmp5 = icmp slt i32 %tmp2, %y ; <i1> [#uses=1] 15 %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1] 16 br i1 %tmp5, label %bb, label %bb7 17 18 bb7: ; preds = %bb 19 ret i32 %tmp2 20 } 21