Skip to content

Commit 2c3d199

Browse files
committed
[InstCombine] regenerate test checks; NFC
1 parent f74a334 commit 2c3d199

File tree

1 file changed

+25
-18
lines changed

1 file changed

+25
-18
lines changed
Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,45 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
12
; RUN: opt < %s -instcombine -S | FileCheck %s
23

34
; Remove an icmp by using its operand in the subsequent logic directly.
45

56
define i8 @zext_or_icmp_icmp(i8 %a, i8 %b) {
7+
; CHECK-LABEL: @zext_or_icmp_icmp(
8+
; CHECK-NEXT: [[MASK:%.*]] = and i8 [[A:%.*]], 1
9+
; CHECK-NEXT: [[TOBOOL2:%.*]] = icmp eq i8 [[B:%.*]], 0
10+
; CHECK-NEXT: [[TOBOOL22:%.*]] = zext i1 [[TOBOOL2]] to i8
11+
; CHECK-NEXT: [[TMP1:%.*]] = xor i8 [[MASK]], 1
12+
; CHECK-NEXT: [[ZEXT3:%.*]] = or i8 [[TMP1]], [[TOBOOL22]]
13+
; CHECK-NEXT: ret i8 [[ZEXT3]]
14+
;
615
%mask = and i8 %a, 1
716
%toBool1 = icmp eq i8 %mask, 0
817
%toBool2 = icmp eq i8 %b, 0
918
%bothCond = or i1 %toBool1, %toBool2
1019
%zext = zext i1 %bothCond to i8
1120
ret i8 %zext
12-
13-
; CHECK-LABEL: zext_or_icmp_icmp(
14-
; CHECK-NEXT: %mask = and i8 %a, 1
15-
; CHECK-NEXT: %toBool2 = icmp eq i8 %b, 0
16-
; CHECK-NEXT: %toBool22 = zext i1 %toBool2 to i8
17-
; CHECK-NEXT: %1 = xor i8 %mask, 1
18-
; CHECK-NEXT: %zext3 = or i8 %1, %toBool22
19-
; CHECK-NEXT: ret i8 %zext
2021
}
2122

2223
; Here, widening the or from i1 to i32 and removing one of the icmps would
2324
; widen an undef value (created by the out-of-range shift), increasing the
2425
; range of valid values for the return, so we can't do it.
26+
2527
define i32 @dont_widen_undef() {
28+
; CHECK-LABEL: @dont_widen_undef(
29+
; CHECK-NEXT: entry:
30+
; CHECK-NEXT: br label [[BLOCK2:%.*]]
31+
; CHECK: block1:
32+
; CHECK-NEXT: br label [[BLOCK2]]
33+
; CHECK: block2:
34+
; CHECK-NEXT: [[CMP_I:%.*]] = phi i1 [ false, [[BLOCK1:%.*]] ], [ true, [[ENTRY:%.*]] ]
35+
; CHECK-NEXT: [[M_011:%.*]] = phi i32 [ 0, [[BLOCK1]] ], [ 33, [[ENTRY]] ]
36+
; CHECK-NEXT: [[M_1_OP:%.*]] = lshr i32 1, [[M_011]]
37+
; CHECK-NEXT: [[SEXT_MASK:%.*]] = and i32 [[M_1_OP]], 65535
38+
; CHECK-NEXT: [[CMP115:%.*]] = icmp ne i32 [[SEXT_MASK]], 0
39+
; CHECK-NEXT: [[CMP1:%.*]] = or i1 [[CMP_I]], [[CMP115]]
40+
; CHECK-NEXT: [[CONV2:%.*]] = zext i1 [[CMP1]] to i32
41+
; CHECK-NEXT: ret i32 [[CONV2]]
42+
;
2643
entry:
2744
br label %block2
2845

@@ -38,14 +55,4 @@ block2:
3855
%cmp1 = or i1 %cmp.i, %cmp115
3956
%conv2 = zext i1 %cmp1 to i32
4057
ret i32 %conv2
41-
42-
; CHECK-LABEL: dont_widen_undef(
43-
; CHECK: %cmp.i = phi i1 [ false, %block1 ], [ true, %entry ]
44-
; CHECK-NEXT: %m.011 = phi i32 [ 0, %block1 ], [ 33, %entry ]
45-
; CHECK-NEXT: %m.1.op = lshr i32 1, %m.011
46-
; CHECK-NEXT: %sext.mask = and i32 %m.1.op, 65535
47-
; CHECK-NEXT: %cmp115 = icmp ne i32 %sext.mask, 0
48-
; CHECK-NEXT: %cmp1 = or i1 %cmp.i, %cmp115
49-
; CHECK-NEXT: %conv2 = zext i1 %cmp1 to i32
50-
; CHECK-NEXT: ret i32 %conv2
5158
}

0 commit comments

Comments
 (0)