@@ -453,6 +453,25 @@ define i1 @src_is_notmask_shl(i8 %x_in, i8 %y, i1 %cond) {
453
453
ret i1 %r
454
454
}
455
455
456
+ define i1 @src_is_notmask_x_xor_neg_x (i8 %x_in , i8 %y , i1 %cond ) {
457
+ ; CHECK-LABEL: @src_is_notmask_x_xor_neg_x(
458
+ ; CHECK-NEXT: [[X:%.*]] = xor i8 [[X_IN:%.*]], 123
459
+ ; CHECK-NEXT: [[NEG_Y:%.*]] = sub i8 0, [[Y:%.*]]
460
+ ; CHECK-NEXT: [[NOTMASK0:%.*]] = xor i8 [[NEG_Y]], [[Y]]
461
+ ; CHECK-NEXT: [[NOTMASK:%.*]] = select i1 [[COND:%.*]], i8 [[NOTMASK0]], i8 -8
462
+ ; CHECK-NEXT: [[AND:%.*]] = and i8 [[X]], [[NOTMASK]]
463
+ ; CHECK-NEXT: [[R:%.*]] = icmp eq i8 [[AND]], 0
464
+ ; CHECK-NEXT: ret i1 [[R]]
465
+ ;
466
+ %x = xor i8 %x_in , 123
467
+ %neg_y = sub i8 0 , %y
468
+ %nmask0 = xor i8 %y , %neg_y
469
+ %notmask = select i1 %cond , i8 %nmask0 , i8 -8
470
+ %and = and i8 %x , %notmask
471
+ %r = icmp eq i8 %and , 0
472
+ ret i1 %r
473
+ }
474
+
456
475
define i1 @src_is_notmask_shl_fail_multiuse_invert (i8 %x_in , i8 %y , i1 %cond ) {
457
476
; CHECK-LABEL: @src_is_notmask_shl_fail_multiuse_invert(
458
477
; CHECK-NEXT: [[X:%.*]] = xor i8 [[X_IN:%.*]], 122
0 commit comments