1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -fix-irreducible -enable-new-pm=0 -S | FileCheck %s
4 define void @loop_1(i32 %Value, i1 %PredEntry, i1 %PredD) {
5 ; CHECK-LABEL: @loop_1(
7 ; CHECK-NEXT: br label [[IRR_GUARD:%.*]]
9 ; CHECK-NEXT: br label [[IRR_GUARD]]
11 ; CHECK-NEXT: br label [[NODEBLOCK:%.*]]
13 ; CHECK-NEXT: [[PIVOT:%.*]] = icmp slt i32 [[VALUE:%.*]], 1
14 ; CHECK-NEXT: br i1 [[PIVOT]], label [[LEAFBLOCK:%.*]], label [[LEAFBLOCK1:%.*]]
16 ; CHECK-NEXT: [[SWITCHLEAF2:%.*]] = icmp eq i32 [[VALUE]], 1
17 ; CHECK-NEXT: br i1 [[SWITCHLEAF2]], label [[IRR_GUARD]], label [[NEWDEFAULT:%.*]]
19 ; CHECK-NEXT: [[SWITCHLEAF:%.*]] = icmp eq i32 [[VALUE]], 0
20 ; CHECK-NEXT: br i1 [[SWITCHLEAF]], label [[IRR_GUARD]], label [[NEWDEFAULT]]
22 ; CHECK-NEXT: br label [[EXIT:%.*]]
24 ; CHECK-NEXT: ret void
26 ; CHECK-NEXT: [[GUARD_A:%.*]] = phi i1 [ true, [[LEAFBLOCK]] ], [ [[PREDENTRY:%.*]], [[ENTRY:%.*]] ], [ false, [[LEAFBLOCK1]] ], [ false, [[A:%.*]] ]
27 ; CHECK-NEXT: br i1 [[GUARD_A]], label [[A]], label [[B:%.*]]
30 br i1 %PredEntry, label %A, label %B
36 switch i32 %Value, label %exit [