1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=simplifycfg,instcombine -simplifycfg-require-and-preserve-domtree=1 -S < %s | FileCheck %s
4 define zeroext i1 @switch_ob_one_two_cases(i32 %arg) {
5 ; CHECK-LABEL: @switch_ob_one_two_cases(
7 ; CHECK-NEXT: [[TMP0:%.*]] = and i32 [[ARG:%.*]], -3
8 ; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[TMP0]], 0
9 ; CHECK-NEXT: ret i1 [[TMP1]]
12 switch i32 %arg, label %bb1 [
21 %i = phi i1 [ false, %bb1 ], [ true, %bb ], [ true, %bb ]
25 define zeroext i1 @switch_ob_one_two_cases2(i32 %arg) {
26 ; CHECK-LABEL: @switch_ob_one_two_cases2(
27 ; CHECK-NEXT: [[I:%.*]] = icmp eq i32 [[ARG:%.*]], 7
28 ; CHECK-NEXT: [[I1:%.*]] = icmp eq i32 [[ARG]], 11
29 ; CHECK-NEXT: [[I2:%.*]] = or i1 [[I]], [[I1]]
30 ; CHECK-NEXT: ret i1 [[I2]]
32 %i = icmp eq i32 %arg, 7
33 %i1 = icmp eq i32 %arg, 11