@@ -153,8 +153,8 @@ define <2 x i64> @shl_constant_op0_not_undef_lane(i64 %x) {
153
153
define <2 x i64 > @shl_constant_op0_load (ptr %p ) {
154
154
; CHECK-LABEL: @shl_constant_op0_load(
155
155
; CHECK-NEXT: [[LD:%.*]] = load i64, ptr [[P:%.*]], align 8
156
- ; CHECK-NEXT: [[INS :%.*]] = insertelement <2 x i64> undef, i64 [[LD]], i32 1
157
- ; CHECK-NEXT: [[BO:%.*]] = shl <2 x i64> <i64 undef , i64 2>, [[INS]]
156
+ ; CHECK-NEXT: [[BO_SCALAR :%.*]] = shl i64 2, [[LD]]
157
+ ; CHECK-NEXT: [[BO:%.*]] = insertelement <2 x i64> poison , i64 [[BO_SCALAR]], i64 1
158
158
; CHECK-NEXT: ret <2 x i64> [[BO]]
159
159
;
160
160
%ld = load i64 , ptr %p
@@ -204,8 +204,8 @@ define <2 x i64> @shl_constant_op1_not_undef_lane(i64 %x) {
204
204
define <2 x i64 > @shl_constant_op1_load (ptr %p ) {
205
205
; CHECK-LABEL: @shl_constant_op1_load(
206
206
; CHECK-NEXT: [[LD:%.*]] = load i64, ptr [[P:%.*]], align 8
207
- ; CHECK-NEXT: [[INS :%.*]] = insertelement <2 x i64> undef, i64 [[LD]], i32 0
208
- ; CHECK-NEXT: [[BO:%.*]] = shl nuw <2 x i64> [[INS ]], < i64 5, i64 2>
207
+ ; CHECK-NEXT: [[BO_SCALAR :%.*]] = shl nuw i64 [[LD]], 5
208
+ ; CHECK-NEXT: [[BO:%.*]] = insertelement <2 x i64> zeroinitializer, i64 [[BO_SCALAR ]], i64 0
209
209
; CHECK-NEXT: ret <2 x i64> [[BO]]
210
210
;
211
211
%ld = load i64 , ptr %p
@@ -479,21 +479,31 @@ define <2 x i64> @sdiv_constant_op1_not_undef_lane(i64 %x) {
479
479
}
480
480
481
481
define <2 x i64 > @and_constant (i64 %x ) {
482
- ; CHECK-LABEL: @and_constant(
483
- ; CHECK-NEXT: [[BO_SCALAR:%.*]] = and i64 [[X:%.*]], 42
484
- ; CHECK-NEXT: [[BO:%.*]] = insertelement <2 x i64> <i64 0, i64 undef>, i64 [[BO_SCALAR]], i64 0
485
- ; CHECK-NEXT: ret <2 x i64> [[BO]]
482
+ ; SSE-LABEL: @and_constant(
483
+ ; SSE-NEXT: [[INS:%.*]] = insertelement <2 x i64> undef, i64 [[X:%.*]], i32 0
484
+ ; SSE-NEXT: [[BO:%.*]] = and <2 x i64> [[INS]], <i64 42, i64 undef>
485
+ ; SSE-NEXT: ret <2 x i64> [[BO]]
486
+ ;
487
+ ; AVX-LABEL: @and_constant(
488
+ ; AVX-NEXT: [[BO_SCALAR:%.*]] = and i64 [[X:%.*]], 42
489
+ ; AVX-NEXT: [[BO:%.*]] = insertelement <2 x i64> <i64 0, i64 undef>, i64 [[BO_SCALAR]], i64 0
490
+ ; AVX-NEXT: ret <2 x i64> [[BO]]
486
491
;
487
492
%ins = insertelement <2 x i64 > undef , i64 %x , i32 0
488
493
%bo = and <2 x i64 > %ins , <i64 42 , i64 undef >
489
494
ret <2 x i64 > %bo
490
495
}
491
496
492
497
define <2 x i64 > @and_constant_not_undef_lane (i64 %x ) {
493
- ; CHECK-LABEL: @and_constant_not_undef_lane(
494
- ; CHECK-NEXT: [[BO_SCALAR:%.*]] = and i64 [[X:%.*]], 42
495
- ; CHECK-NEXT: [[BO:%.*]] = insertelement <2 x i64> zeroinitializer, i64 [[BO_SCALAR]], i64 0
496
- ; CHECK-NEXT: ret <2 x i64> [[BO]]
498
+ ; SSE-LABEL: @and_constant_not_undef_lane(
499
+ ; SSE-NEXT: [[INS:%.*]] = insertelement <2 x i64> undef, i64 [[X:%.*]], i32 0
500
+ ; SSE-NEXT: [[BO:%.*]] = and <2 x i64> [[INS]], <i64 42, i64 -42>
501
+ ; SSE-NEXT: ret <2 x i64> [[BO]]
502
+ ;
503
+ ; AVX-LABEL: @and_constant_not_undef_lane(
504
+ ; AVX-NEXT: [[BO_SCALAR:%.*]] = and i64 [[X:%.*]], 42
505
+ ; AVX-NEXT: [[BO:%.*]] = insertelement <2 x i64> zeroinitializer, i64 [[BO_SCALAR]], i64 0
506
+ ; AVX-NEXT: ret <2 x i64> [[BO]]
497
507
;
498
508
%ins = insertelement <2 x i64 > undef , i64 %x , i32 0
499
509
%bo = and <2 x i64 > %ins , <i64 42 , i64 -42 >
@@ -523,10 +533,15 @@ define <2 x i64> @or_constant_not_undef_lane(i64 %x) {
523
533
}
524
534
525
535
define <2 x i64 > @xor_constant (i64 %x ) {
526
- ; CHECK-LABEL: @xor_constant(
527
- ; CHECK-NEXT: [[BO_SCALAR:%.*]] = xor i64 [[X:%.*]], 42
528
- ; CHECK-NEXT: [[BO:%.*]] = insertelement <2 x i64> <i64 undef, i64 0>, i64 [[BO_SCALAR]], i64 0
529
- ; CHECK-NEXT: ret <2 x i64> [[BO]]
536
+ ; SSE-LABEL: @xor_constant(
537
+ ; SSE-NEXT: [[INS:%.*]] = insertelement <2 x i64> undef, i64 [[X:%.*]], i32 0
538
+ ; SSE-NEXT: [[BO:%.*]] = xor <2 x i64> [[INS]], <i64 42, i64 undef>
539
+ ; SSE-NEXT: ret <2 x i64> [[BO]]
540
+ ;
541
+ ; AVX-LABEL: @xor_constant(
542
+ ; AVX-NEXT: [[BO_SCALAR:%.*]] = xor i64 [[X:%.*]], 42
543
+ ; AVX-NEXT: [[BO:%.*]] = insertelement <2 x i64> <i64 undef, i64 0>, i64 [[BO_SCALAR]], i64 0
544
+ ; AVX-NEXT: ret <2 x i64> [[BO]]
530
545
;
531
546
%ins = insertelement <2 x i64 > undef , i64 %x , i32 0
532
547
%bo = xor <2 x i64 > %ins , <i64 42 , i64 undef >
@@ -546,8 +561,8 @@ define <2 x i64> @xor_constant_not_undef_lane(i64 %x) {
546
561
547
562
define <2 x double > @fadd_constant (double %x ) {
548
563
; CHECK-LABEL: @fadd_constant(
549
- ; CHECK-NEXT: [[BO_SCALAR :%.*]] = fadd double [[X:%.*]], 4.200000e+01
550
- ; CHECK-NEXT: [[BO:%.*]] = insertelement <2 x double> <double 0x7FF8000000000000 , double undef>, double [[BO_SCALAR]], i64 0
564
+ ; CHECK-NEXT: [[INS :%.*]] = insertelement <2 x double> undef, double [[X:%.*]], i32 0
565
+ ; CHECK-NEXT: [[BO:%.*]] = fadd <2 x double> [[INS]], <double 4.200000e+01 , double undef>
551
566
; CHECK-NEXT: ret <2 x double> [[BO]]
552
567
;
553
568
%ins = insertelement <2 x double > undef , double %x , i32 0
@@ -568,8 +583,8 @@ define <2 x double> @fadd_constant_not_undef_lane(double %x) {
568
583
569
584
define <2 x double > @fsub_constant_op0 (double %x ) {
570
585
; CHECK-LABEL: @fsub_constant_op0(
571
- ; CHECK-NEXT: [[BO_SCALAR :%.*]] = fsub fast double 4.200000e+01, [[X:%.*]]
572
- ; CHECK-NEXT: [[BO:%.*]] = insertelement <2 x double> <double 0x7FF8000000000000 , double undef>, double [[BO_SCALAR]], i64 0
586
+ ; CHECK-NEXT: [[INS :%.*]] = insertelement <2 x double> undef, double [[X:%.*]], i32 0
587
+ ; CHECK-NEXT: [[BO:%.*]] = fsub fast <2 x double> <double 4.200000e+01 , double undef>, [[INS]]
573
588
; CHECK-NEXT: ret <2 x double> [[BO]]
574
589
;
575
590
%ins = insertelement <2 x double > undef , double %x , i32 0
@@ -601,8 +616,8 @@ define <2 x double> @fsub_constant_op1(double %x) {
601
616
602
617
define <2 x double > @fsub_constant_op1_not_undef_lane (double %x ) {
603
618
; CHECK-LABEL: @fsub_constant_op1_not_undef_lane(
604
- ; CHECK-NEXT: [[BO_SCALAR :%.*]] = fsub double [[X:%.*]], 4.200000e+01
605
- ; CHECK-NEXT: [[BO:%.*]] = insertelement <2 x double> splat (double 0x7FF8000000000000), double [[BO_SCALAR ]], i64 0
619
+ ; CHECK-NEXT: [[INS :%.*]] = insertelement <2 x double> undef, double [[X:%.*]], i32 0
620
+ ; CHECK-NEXT: [[BO:%.*]] = fsub <2 x double> [[INS ]], <double 4.200000e+01, double -4.200000e+01>
606
621
; CHECK-NEXT: ret <2 x double> [[BO]]
607
622
;
608
623
%ins = insertelement <2 x double > undef , double %x , i32 0
@@ -612,8 +627,8 @@ define <2 x double> @fsub_constant_op1_not_undef_lane(double %x) {
612
627
613
628
define <2 x double > @fmul_constant (double %x ) {
614
629
; CHECK-LABEL: @fmul_constant(
615
- ; CHECK-NEXT: [[BO_SCALAR :%.*]] = fmul reassoc double [[X:%.*]], 4.200000e+01
616
- ; CHECK-NEXT: [[BO:%.*]] = insertelement <2 x double> <double 0x7FF8000000000000 , double undef>, double [[BO_SCALAR]], i64 0
630
+ ; CHECK-NEXT: [[INS :%.*]] = insertelement <2 x double> undef, double [[X:%.*]], i32 0
631
+ ; CHECK-NEXT: [[BO:%.*]] = fmul reassoc <2 x double> [[INS]], <double 4.200000e+01 , double undef>
617
632
; CHECK-NEXT: ret <2 x double> [[BO]]
618
633
;
619
634
%ins = insertelement <2 x double > undef , double %x , i32 0
@@ -644,32 +659,47 @@ define <2 x double> @fdiv_constant_op0(double %x) {
644
659
}
645
660
646
661
define <2 x double > @fdiv_constant_op0_not_undef_lane (double %x ) {
647
- ; CHECK-LABEL: @fdiv_constant_op0_not_undef_lane(
648
- ; CHECK-NEXT: [[BO_SCALAR:%.*]] = fdiv ninf double 4.200000e+01, [[X:%.*]]
649
- ; CHECK-NEXT: [[BO:%.*]] = insertelement <2 x double> splat (double 0x7FF8000000000000), double [[BO_SCALAR]], i64 0
650
- ; CHECK-NEXT: ret <2 x double> [[BO]]
662
+ ; SSE-LABEL: @fdiv_constant_op0_not_undef_lane(
663
+ ; SSE-NEXT: [[BO_SCALAR:%.*]] = fdiv ninf double 4.200000e+01, [[X:%.*]]
664
+ ; SSE-NEXT: [[BO:%.*]] = insertelement <2 x double> splat (double 0x7FF8000000000000), double [[BO_SCALAR]], i64 0
665
+ ; SSE-NEXT: ret <2 x double> [[BO]]
666
+ ;
667
+ ; AVX-LABEL: @fdiv_constant_op0_not_undef_lane(
668
+ ; AVX-NEXT: [[INS:%.*]] = insertelement <2 x double> undef, double [[X:%.*]], i32 0
669
+ ; AVX-NEXT: [[BO:%.*]] = fdiv ninf <2 x double> <double 4.200000e+01, double -4.200000e+01>, [[INS]]
670
+ ; AVX-NEXT: ret <2 x double> [[BO]]
651
671
;
652
672
%ins = insertelement <2 x double > undef , double %x , i32 0
653
673
%bo = fdiv ninf <2 x double > <double 42 .0 , double -42 .0 >, %ins
654
674
ret <2 x double > %bo
655
675
}
656
676
657
677
define <2 x double > @fdiv_constant_op1 (double %x ) {
658
- ; CHECK-LABEL: @fdiv_constant_op1(
659
- ; CHECK-NEXT: [[BO_SCALAR:%.*]] = fdiv double [[X:%.*]], 4.200000e+01
660
- ; CHECK-NEXT: [[BO:%.*]] = insertelement <2 x double> <double 0x7FF8000000000000, double undef>, double [[BO_SCALAR]], i64 0
661
- ; CHECK-NEXT: ret <2 x double> [[BO]]
678
+ ; SSE-LABEL: @fdiv_constant_op1(
679
+ ; SSE-NEXT: [[BO_SCALAR:%.*]] = fdiv double [[X:%.*]], 4.200000e+01
680
+ ; SSE-NEXT: [[BO:%.*]] = insertelement <2 x double> <double 0x7FF8000000000000, double undef>, double [[BO_SCALAR]], i64 0
681
+ ; SSE-NEXT: ret <2 x double> [[BO]]
682
+ ;
683
+ ; AVX-LABEL: @fdiv_constant_op1(
684
+ ; AVX-NEXT: [[INS:%.*]] = insertelement <2 x double> undef, double [[X:%.*]], i32 0
685
+ ; AVX-NEXT: [[BO:%.*]] = fdiv <2 x double> [[INS]], <double 4.200000e+01, double undef>
686
+ ; AVX-NEXT: ret <2 x double> [[BO]]
662
687
;
663
688
%ins = insertelement <2 x double > undef , double %x , i32 0
664
689
%bo = fdiv <2 x double > %ins , <double 42 .0 , double undef >
665
690
ret <2 x double > %bo
666
691
}
667
692
668
693
define <2 x double > @fdiv_constant_op1_not_undef_lane (double %x ) {
669
- ; CHECK-LABEL: @fdiv_constant_op1_not_undef_lane(
670
- ; CHECK-NEXT: [[BO_SCALAR:%.*]] = fdiv double [[X:%.*]], 4.200000e+01
671
- ; CHECK-NEXT: [[BO:%.*]] = insertelement <2 x double> splat (double 0x7FF8000000000000), double [[BO_SCALAR]], i64 0
672
- ; CHECK-NEXT: ret <2 x double> [[BO]]
694
+ ; SSE-LABEL: @fdiv_constant_op1_not_undef_lane(
695
+ ; SSE-NEXT: [[BO_SCALAR:%.*]] = fdiv double [[X:%.*]], 4.200000e+01
696
+ ; SSE-NEXT: [[BO:%.*]] = insertelement <2 x double> splat (double 0x7FF8000000000000), double [[BO_SCALAR]], i64 0
697
+ ; SSE-NEXT: ret <2 x double> [[BO]]
698
+ ;
699
+ ; AVX-LABEL: @fdiv_constant_op1_not_undef_lane(
700
+ ; AVX-NEXT: [[INS:%.*]] = insertelement <2 x double> undef, double [[X:%.*]], i32 0
701
+ ; AVX-NEXT: [[BO:%.*]] = fdiv <2 x double> [[INS]], <double 4.200000e+01, double -4.200000e+01>
702
+ ; AVX-NEXT: ret <2 x double> [[BO]]
673
703
;
674
704
%ins = insertelement <2 x double > undef , double %x , i32 0
675
705
%bo = fdiv <2 x double > %ins , <double 42 .0 , double -42 .0 >
0 commit comments