1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=newgvn -S %s | FileCheck %s
4 define void @crash1_pr35074(i32 %this, i1 %c) {
5 ; CHECK-LABEL: @crash1_pr35074(
7 ; CHECK-NEXT: br label [[FOR_COND:%.*]]
9 ; CHECK-NEXT: [[PHIOFOPS:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[Y_0:%.*]], [[FOR_INC6:%.*]] ]
10 ; CHECK-NEXT: [[Y_0]] = phi i32 [ 1, [[ENTRY]] ], [ [[INC7:%.*]], [[FOR_INC6]] ]
11 ; CHECK-NEXT: br i1 [[C:%.*]], label [[FOR_INC6]], label [[FOR_BODY_LR_PH:%.*]]
12 ; CHECK: for.body.lr.ph:
13 ; CHECK-NEXT: br label [[FOR_BODY4:%.*]]
15 ; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i32 [[PHIOFOPS]], [[Y_0]]
16 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_END:%.*]], label [[FOR_BODY4_1:%.*]]
18 ; CHECK-NEXT: ret void
20 ; CHECK-NEXT: [[INC7]] = add nuw nsw i32 [[Y_0]], 1
21 ; CHECK-NEXT: br label [[FOR_COND]]
23 ; CHECK-NEXT: [[INC_1:%.*]] = add nuw nsw i32 [[Y_0]], 1
24 ; CHECK-NEXT: tail call void @_blah(i32 [[INC_1]])
25 ; CHECK-NEXT: br label [[FOR_END]]
30 for.cond: ; preds = %for.inc6, %entry
31 %y.0 = phi i32 [ 1, %entry ], [ %inc7, %for.inc6 ]
32 br i1 %c, label %for.inc6, label %for.body.lr.ph
34 for.body.lr.ph: ; preds = %for.cond
35 %sub = add nsw i32 %y.0, -1
38 for.body4: ; preds = %for.body.lr.ph
39 %cmp = icmp ugt i32 %sub, %y.0
40 br i1 %cmp, label %for.end, label %for.body4.1
42 for.end: ; preds = %for.body4.1, %for.body4
45 for.inc6: ; preds = %for.cond
46 %inc7 = add nuw nsw i32 %y.0, 1
49 for.body4.1: ; preds = %for.body4
50 %inc.1 = add nuw nsw i32 %y.0, 1
51 tail call void @_blah(i32 %inc.1)
55 declare void @_blah(i32)