@@ -335,9 +335,9 @@ define i64 @lshr_mul_negative_nsw(i64 %0) {
335
335
336
336
define i8 @shl_add (i8 %x , i8 %y ) {
337
337
; CHECK-LABEL: @shl_add(
338
- ; CHECK-NEXT: [[TMP1 :%.*]] = shl i8 [[X:%.*]], 5
339
- ; CHECK-NEXT: [[TMP2 :%.*]] = shl i8 [[Y:%.*]], 2
340
- ; CHECK-NEXT: [[SH1:%.*]] = add i8 [[TMP1 ]], [[TMP2]]
338
+ ; CHECK-NEXT: [[SH0 :%.*]] = shl i8 [[X:%.*]], 3
339
+ ; CHECK-NEXT: [[R :%.*]] = add i8 [[SH0]], [[ Y:%.*]]
340
+ ; CHECK-NEXT: [[SH1:%.*]] = shl i8 [[R ]], 2
341
341
; CHECK-NEXT: ret i8 [[SH1]]
342
342
;
343
343
%sh0 = shl i8 %x , 3
@@ -348,9 +348,9 @@ define i8 @shl_add(i8 %x, i8 %y) {
348
348
349
349
define <2 x i8 > @shl_add_nonuniform (<2 x i8 > %x , <2 x i8 > %y ) {
350
350
; CHECK-LABEL: @shl_add_nonuniform(
351
- ; CHECK-NEXT: [[TMP1 :%.*]] = shl <2 x i8> [[X:%.*]], <i8 5 , i8 4>
352
- ; CHECK-NEXT: [[TMP2 :%.*]] = shl <2 x i8> [[Y:%.*]], <i8 2, i8 0>
353
- ; CHECK-NEXT: [[SH1:%.*]] = add <2 x i8> [[TMP1 ]], [[TMP2]]
351
+ ; CHECK-NEXT: [[SH0 :%.*]] = shl <2 x i8> [[X:%.*]], <i8 3 , i8 4>
352
+ ; CHECK-NEXT: [[R :%.*]] = add <2 x i8> [[SH0]], [[ Y:%.*]]
353
+ ; CHECK-NEXT: [[SH1:%.*]] = shl <2 x i8> [[R ]], <i8 2, i8 0>
354
354
; CHECK-NEXT: ret <2 x i8> [[SH1]]
355
355
;
356
356
%sh0 = shl <2 x i8 > %x , <i8 3 , i8 4 >
@@ -363,9 +363,9 @@ define <2 x i8> @shl_add_nonuniform(<2 x i8> %x, <2 x i8> %y) {
363
363
define <2 x i64 > @shl_add_undef (<2 x i64 > %x , <2 x i64 > %py ) {
364
364
; CHECK-LABEL: @shl_add_undef(
365
365
; CHECK-NEXT: [[Y:%.*]] = srem <2 x i64> [[PY:%.*]], <i64 42, i64 42>
366
- ; CHECK-NEXT: [[TMP1 :%.*]] = shl <2 x i64> [[X:%.*]], <i64 12 , i64 undef>
367
- ; CHECK-NEXT: [[TMP2 :%.*]] = shl <2 x i64> [[Y]], <i64 7, i64 undef>
368
- ; CHECK-NEXT: [[SH1:%.*]] = add <2 x i64> [[TMP1 ]], [[TMP2]]
366
+ ; CHECK-NEXT: [[SH0 :%.*]] = shl <2 x i64> [[X:%.*]], <i64 5 , i64 undef>
367
+ ; CHECK-NEXT: [[R :%.*]] = add <2 x i64> [[Y]], [[SH0]]
368
+ ; CHECK-NEXT: [[SH1:%.*]] = shl <2 x i64> [[R ]], <i64 7, i64 undef>
369
369
; CHECK-NEXT: ret <2 x i64> [[SH1]]
370
370
;
371
371
%y = srem <2 x i64 > %py , <i64 42 , i64 42 > ; thwart complexity-based canonicalization
@@ -419,9 +419,9 @@ define <2 x i64> @lshr_add_undef(<2 x i64> %x, <2 x i64> %py) {
419
419
420
420
define i8 @shl_sub (i8 %x , i8 %y ) {
421
421
; CHECK-LABEL: @shl_sub(
422
- ; CHECK-NEXT: [[TMP1 :%.*]] = shl i8 [[X:%.*]], 5
423
- ; CHECK-NEXT: [[TMP2 :%.*]] = shl i8 [[Y:%.*]], 2
424
- ; CHECK-NEXT: [[SH1:%.*]] = sub i8 [[TMP1 ]], [[TMP2]]
422
+ ; CHECK-NEXT: [[SH0 :%.*]] = shl i8 [[X:%.*]], 3
423
+ ; CHECK-NEXT: [[R :%.*]] = sub i8 [[SH0]], [[ Y:%.*]]
424
+ ; CHECK-NEXT: [[SH1:%.*]] = shl i8 [[R ]], 2
425
425
; CHECK-NEXT: ret i8 [[SH1]]
426
426
;
427
427
%sh0 = shl i8 %x , 3
@@ -433,9 +433,9 @@ define i8 @shl_sub(i8 %x, i8 %y) {
433
433
; Make sure we don't commute operands for sub
434
434
define i8 @shl_sub_no_commute (i8 %x , i8 %y ) {
435
435
; CHECK-LABEL: @shl_sub_no_commute(
436
- ; CHECK-NEXT: [[TMP1 :%.*]] = shl i8 [[Y:%.*]], 5
437
- ; CHECK-NEXT: [[TMP2 :%.*]] = shl i8 [[X:%.*]], 2
438
- ; CHECK-NEXT: [[SH1:%.*]] = sub i8 [[TMP2 ]], [[TMP1]]
436
+ ; CHECK-NEXT: [[SH0 :%.*]] = shl i8 [[Y:%.*]], 3
437
+ ; CHECK-NEXT: [[R :%.*]] = sub i8 [[X:%.*]], [[SH0]]
438
+ ; CHECK-NEXT: [[SH1:%.*]] = shl i8 [[R ]], 2
439
439
; CHECK-NEXT: ret i8 [[SH1]]
440
440
;
441
441
%sh0 = shl i8 %y , 3
@@ -446,9 +446,9 @@ define i8 @shl_sub_no_commute(i8 %x, i8 %y) {
446
446
447
447
define <2 x i8 > @shl_sub_nonuniform (<2 x i8 > %x , <2 x i8 > %y ) {
448
448
; CHECK-LABEL: @shl_sub_nonuniform(
449
- ; CHECK-NEXT: [[TMP1 :%.*]] = shl <2 x i8> [[X:%.*]], <i8 5 , i8 4>
450
- ; CHECK-NEXT: [[TMP2 :%.*]] = shl <2 x i8> [[Y:%.*]], <i8 2, i8 0>
451
- ; CHECK-NEXT: [[SH1:%.*]] = sub <2 x i8> [[TMP1 ]], [[TMP2]]
449
+ ; CHECK-NEXT: [[SH0 :%.*]] = shl <2 x i8> [[X:%.*]], <i8 3 , i8 4>
450
+ ; CHECK-NEXT: [[R :%.*]] = sub <2 x i8> [[SH0]], [[ Y:%.*]]
451
+ ; CHECK-NEXT: [[SH1:%.*]] = shl <2 x i8> [[R ]], <i8 2, i8 0>
452
452
; CHECK-NEXT: ret <2 x i8> [[SH1]]
453
453
;
454
454
%sh0 = shl <2 x i8 > %x , <i8 3 , i8 4 >
@@ -461,9 +461,9 @@ define <2 x i8> @shl_sub_nonuniform(<2 x i8> %x, <2 x i8> %y) {
461
461
define <2 x i64 > @shl_sub_undef (<2 x i64 > %x , <2 x i64 > %py ) {
462
462
; CHECK-LABEL: @shl_sub_undef(
463
463
; CHECK-NEXT: [[Y:%.*]] = srem <2 x i64> [[PY:%.*]], <i64 42, i64 42>
464
- ; CHECK-NEXT: [[TMP1 :%.*]] = shl <2 x i64> [[X:%.*]], <i64 12 , i64 undef>
465
- ; CHECK-NEXT: [[TMP2 :%.*]] = shl <2 x i64> [[Y]], <i64 7, i64 undef>
466
- ; CHECK-NEXT: [[SH1:%.*]] = sub <2 x i64> [[TMP2 ]], [[TMP1]]
464
+ ; CHECK-NEXT: [[SH0 :%.*]] = shl <2 x i64> [[X:%.*]], <i64 5 , i64 undef>
465
+ ; CHECK-NEXT: [[R :%.*]] = sub <2 x i64> [[Y]], [[SH0]]
466
+ ; CHECK-NEXT: [[SH1:%.*]] = shl <2 x i64> [[R ]], <i64 7, i64 undef>
467
467
; CHECK-NEXT: ret <2 x i64> [[SH1]]
468
468
;
469
469
%y = srem <2 x i64 > %py , <i64 42 , i64 42 > ; thwart complexity-based canonicalization
0 commit comments