Skip to content

Commit d179463

Browse files
committed
[InstCombine] Add pre-commit tests. NFC.
1 parent 69f7758 commit d179463

File tree

1 file changed

+15
-0
lines changed
  • llvm/test/Transforms/InstCombine

1 file changed

+15
-0
lines changed

llvm/test/Transforms/InstCombine/icmp.ll

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3203,6 +3203,21 @@ define i1 @icmp_and_or_lshr(i32 %x, i32 %y) {
32033203
ret i1 %ret
32043204
}
32053205

3206+
define i1 @icmp_and_or_lshr_samesign(i32 %x, i32 %y) {
3207+
; CHECK-LABEL: @icmp_and_or_lshr_samesign(
3208+
; CHECK-NEXT: [[SHF1:%.*]] = shl nuw i32 1, [[Y:%.*]]
3209+
; CHECK-NEXT: [[OR2:%.*]] = or i32 [[SHF1]], 1
3210+
; CHECK-NEXT: [[AND3:%.*]] = and i32 [[X:%.*]], [[OR2]]
3211+
; CHECK-NEXT: [[RET:%.*]] = icmp samesign ne i32 [[AND3]], 0
3212+
; CHECK-NEXT: ret i1 [[RET]]
3213+
;
3214+
%shf = lshr i32 %x, %y
3215+
%or = or i32 %shf, %x
3216+
%and = and i32 %or, 1
3217+
%ret = icmp samesign ne i32 %and, 0
3218+
ret i1 %ret
3219+
}
3220+
32063221
define <2 x i1> @icmp_and_or_lshr_vec(<2 x i32> %x, <2 x i32> %y) {
32073222
; CHECK-LABEL: @icmp_and_or_lshr_vec(
32083223
; CHECK-NEXT: [[SHF:%.*]] = lshr <2 x i32> [[X:%.*]], [[Y:%.*]]

0 commit comments

Comments
 (0)