We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 69f7758 commit 0019d6cCopy full SHA for 0019d6c
llvm/test/Transforms/InstCombine/and-or-icmps.ll
@@ -3416,3 +3416,16 @@ define i1 @and_ugt_to_mask_off_by_one(i8 %x) {
3416
%and2 = and i1 %cmp, %cmp2
3417
ret i1 %and2
3418
}
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