@@ -408,9 +408,9 @@ define i1 @not_select_cmpf_extra_use(i1 %x, i32 %z, i32 %w, i1 %cond) {
408
408
409
409
define i8 @not_or_neg (i8 %x , i8 %y ) {
410
410
; CHECK-LABEL: @not_or_neg(
411
- ; CHECK-NEXT: [[S :%.*]] = sub i8 0, [[Y:%.*]]
412
- ; CHECK-NEXT: [[O :%.*]] = or i8 [[S]], [[ X:%.*]]
413
- ; CHECK-NEXT: [[NOT:%.*]] = xor i8 [[O ]], -1
411
+ ; CHECK-NEXT: [[TMP1 :%.*]] = add i8 [[Y:%.*]], -1
412
+ ; CHECK-NEXT: [[TMP2 :%.*]] = xor i8 [[X:%.*]], -1
413
+ ; CHECK-NEXT: [[NOT:%.*]] = and i8 [[TMP1 ]], [[TMP2]]
414
414
; CHECK-NEXT: ret i8 [[NOT]]
415
415
;
416
416
%s = sub i8 0 , %y
@@ -422,9 +422,9 @@ define i8 @not_or_neg(i8 %x, i8 %y) {
422
422
define <3 x i5 > @not_or_neg_commute_vec (<3 x i5 > %x , <3 x i5 > %p ) {
423
423
; CHECK-LABEL: @not_or_neg_commute_vec(
424
424
; CHECK-NEXT: [[Y:%.*]] = mul <3 x i5> [[P:%.*]], <i5 1, i5 2, i5 3>
425
- ; CHECK-NEXT: [[S :%.*]] = sub <3 x i5> <i5 0 , i5 0 , i5 undef>, [[X:%.*]]
426
- ; CHECK-NEXT: [[O :%.*]] = or <3 x i5> [[Y]], [[S]]
427
- ; CHECK-NEXT: [[NOT:%.*]] = xor <3 x i5> [[O ]], <i5 -1, i5 undef, i5 -1>
425
+ ; CHECK-NEXT: [[TMP1 :%.*]] = add <3 x i5> [[X:%.*]], <i5 -1 , i5 -1 , i5 -1>
426
+ ; CHECK-NEXT: [[TMP2 :%.*]] = xor <3 x i5> [[Y]], <i5 -1, i5 -1, i5 -1>
427
+ ; CHECK-NEXT: [[NOT:%.*]] = and <3 x i5> [[TMP1 ]], [[TMP2]]
428
428
; CHECK-NEXT: ret <3 x i5> [[NOT]]
429
429
;
430
430
%y = mul <3 x i5 > %p , <i5 1 , i5 2 , i5 3 > ; thwart complexity-based-canonicalization
@@ -434,6 +434,8 @@ define <3 x i5> @not_or_neg_commute_vec(<3 x i5> %x, <3 x i5> %p) {
434
434
ret <3 x i5 > %not
435
435
}
436
436
437
+ ; negative test
438
+
437
439
define i8 @not_or_neg_use1 (i8 %x , i8 %y ) {
438
440
; CHECK-LABEL: @not_or_neg_use1(
439
441
; CHECK-NEXT: [[S:%.*]] = sub i8 0, [[Y:%.*]]
@@ -449,6 +451,8 @@ define i8 @not_or_neg_use1(i8 %x, i8 %y) {
449
451
ret i8 %not
450
452
}
451
453
454
+ ; negative test
455
+
452
456
define i8 @not_or_neg_use2 (i8 %x , i8 %y ) {
453
457
; CHECK-LABEL: @not_or_neg_use2(
454
458
; CHECK-NEXT: [[S:%.*]] = sub i8 0, [[Y:%.*]]
0 commit comments