Skip to content

Commit 0019d6c

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

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

llvm/test/Transforms/InstCombine/and-or-icmps.ll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3416,3 +3416,16 @@ define i1 @and_ugt_to_mask_off_by_one(i8 %x) {
34163416
%and2 = and i1 %cmp, %cmp2
34173417
ret i1 %and2
34183418
}
3419+
3420+
define i1 @logical_or_icmp_eq_const_samesign(i8 %x, i8 %y) {
3421+
; CHECK-LABEL: @logical_or_icmp_eq_const_samesign(
3422+
; CHECK-NEXT: [[CMPEQ:%.*]] = icmp samesign ne i8 [[X:%.*]], 0
3423+
; CHECK-NEXT: [[TMP1:%.*]] = icmp slt i8 [[Y:%.*]], 0
3424+
; CHECK-NEXT: [[R:%.*]] = or i1 [[CMPEQ]], [[TMP1]]
3425+
; CHECK-NEXT: ret i1 [[R]]
3426+
;
3427+
%cmp = icmp sgt i8 %x, %y
3428+
%cmpeq = icmp samesign ne i8 %x, 0
3429+
%r = select i1 %cmp, i1 true, i1 %cmpeq
3430+
ret i1 %r
3431+
}

0 commit comments

Comments
 (0)