1 ; RUN: opt < %s -indvars -S > %t 2 ; RUN: not grep sext %t 3 ; RUN: grep phi %t | count 1 4 5 define void @foo(i64* nocapture %x, i32 %n) nounwind { 6 entry: 7 %tmp102 = icmp sgt i32 %n, 0 ; <i1> [#uses=1] 8 br i1 %tmp102, label %bb.nph, label %return 9 10 bb.nph: ; preds = %entry 11 br label %bb 12 13 bb: ; preds = %bb7, %bb.nph 14 %i.01 = phi i32 [ %tmp6, %bb7 ], [ 0, %bb.nph ] ; <i32> [#uses=3] 15 %tmp1 = sext i32 %i.01 to i64 ; <i64> [#uses=1] 16 %tmp4 = getelementptr i64* %x, i32 %i.01 ; <i64*> [#uses=1] 17 store i64 %tmp1, i64* %tmp4, align 8 18 %tmp6 = add i32 %i.01, 1 ; <i32> [#uses=2] 19 br label %bb7 20 21 bb7: ; preds = %bb 22 %tmp10 = icmp slt i32 %tmp6, %n ; <i1> [#uses=1] 23 br i1 %tmp10, label %bb, label %bb7.return_crit_edge 24 25 bb7.return_crit_edge: ; preds = %bb7 26 br label %return 27 28 return: ; preds = %bb7.return_crit_edge, %entry 29 ret void 30 } 31