1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
4 define dso_local i32 @readCBPandCoeffsFromNAL(i1 %c, i32 %x, i32 %y) local_unnamed_addr {
5 ; CHECK-LABEL: @readCBPandCoeffsFromNAL(
7 ; CHECK-NEXT: br i1 [[C:%.*]], label [[IF_END80:%.*]], label [[COMMON_RET:%.*]]
9 ; CHECK-NEXT: [[COMMON_RET_OP:%.*]] = phi i32 [ [[Y:%.*]], [[IF_END:%.*]] ], [ 1, [[IF_END172237:%.*]] ], [ 0, [[IF_END80]] ], [ 0, [[IF_END80]] ]
10 ; CHECK-NEXT: ret i32 [[COMMON_RET_OP]]
12 ; CHECK-NEXT: switch i32 [[X:%.*]], label [[INFLOOP:%.*]] [
13 ; CHECK-NEXT: i32 10, label [[IF_END172237]]
14 ; CHECK-NEXT: i32 14, label [[IF_END172237]]
15 ; CHECK-NEXT: i32 9, label [[COMMON_RET]]
16 ; CHECK-NEXT: i32 12, label [[COMMON_RET]]
18 ; CHECK: if.end172237:
19 ; CHECK-NEXT: br label [[COMMON_RET]]
21 ; CHECK-NEXT: br label [[INFLOOP]]
24 br i1 %c, label %if.end80, label %if.then64
26 if.then64: ; preds = %if.end
29 if.end80: ; preds = %if.end
30 switch i32 %x, label %lor.lhs.false89 [
31 i32 10, label %if.end172237
32 i32 14, label %if.end172237
33 i32 9, label %if.end172
36 lor.lhs.false89: ; preds = %lor.lhs.false89, %if.end80
37 %cmp91 = icmp eq i32 %x, 12
38 br i1 %cmp91, label %if.end172, label %lor.lhs.false89
40 if.end172: ; preds = %lor.lhs.false89, %if.end80
43 if.end172237: ; preds = %if.end80, %if.end80
46 if.end239: ; preds = %if.end172237, %if.end172
47 %cbp.0 = phi i32 [ 1, %if.end172237 ], [ 0, %if.end172 ]