1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -instcombine < %s -S | FileCheck %s
4 define void @test() #0 {
7 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
9 ; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]
10 ; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
11 ; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ult i64 [[INDVARS_IV_NEXT]], 40
12 ; CHECK-NEXT: br i1 [[EXITCOND]], label [[FOR_END:%.*]], label [[FOR_BODY]]
14 ; CHECK-NEXT: ret void
19 for.body: ; preds = %for.body, %entry
20 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
21 %indvars.iv.next = add nsw i64 %indvars.iv, 1
22 %exitcond = icmp slt i64 %indvars.iv.next, 40
23 br i1 %exitcond, label %for.end, label %for.body
25 for.end: ; preds = %for.body