mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
[X86] Disable VPBLENDVB formation in combineLogicBlendIntoPBLENDV if VPTERNLOG is supported.
VPBLENDVB is multiple uops while VPTERNLOG is a single uop. So we should use that instead. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D83155
This commit is contained in:
parent
16b97ffa0a
commit
9e30339dbf
@ -42936,6 +42936,10 @@ static SDValue combineLogicBlendIntoPBLENDV(SDNode *N, SelectionDAG &DAG,
|
|||||||
if (!Subtarget.hasSSE41())
|
if (!Subtarget.hasSSE41())
|
||||||
return SDValue();
|
return SDValue();
|
||||||
|
|
||||||
|
// If we have VPTERNLOG we should prefer that since PBLENDVB is multiple uops.
|
||||||
|
if (Subtarget.hasVLX())
|
||||||
|
return SDValue();
|
||||||
|
|
||||||
MVT BlendVT = VT.is256BitVector() ? MVT::v32i8 : MVT::v16i8;
|
MVT BlendVT = VT.is256BitVector() ? MVT::v32i8 : MVT::v16i8;
|
||||||
|
|
||||||
X = DAG.getBitcast(BlendVT, X);
|
X = DAG.getBitcast(BlendVT, X);
|
||||||
|
@ -52,14 +52,23 @@ define <16 x i8> @vselect_packss_v16i16(<16 x i16> %a0, <16 x i16> %a1, <16 x i8
|
|||||||
; AVX2-NEXT: vzeroupper
|
; AVX2-NEXT: vzeroupper
|
||||||
; AVX2-NEXT: retq
|
; AVX2-NEXT: retq
|
||||||
;
|
;
|
||||||
; AVX512NOBW-LABEL: vselect_packss_v16i16:
|
; AVX512F-LABEL: vselect_packss_v16i16:
|
||||||
; AVX512NOBW: # %bb.0:
|
; AVX512F: # %bb.0:
|
||||||
; AVX512NOBW-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
|
; AVX512F-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
|
||||||
; AVX512NOBW-NEXT: vpmovzxwd {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero
|
; AVX512F-NEXT: vpmovzxwd {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero
|
||||||
; AVX512NOBW-NEXT: vpmovdb %zmm0, %xmm0
|
; AVX512F-NEXT: vpmovdb %zmm0, %xmm0
|
||||||
; AVX512NOBW-NEXT: vpblendvb %xmm0, %xmm2, %xmm3, %xmm0
|
; AVX512F-NEXT: vpblendvb %xmm0, %xmm2, %xmm3, %xmm0
|
||||||
; AVX512NOBW-NEXT: vzeroupper
|
; AVX512F-NEXT: vzeroupper
|
||||||
; AVX512NOBW-NEXT: retq
|
; AVX512F-NEXT: retq
|
||||||
|
;
|
||||||
|
; AVX512VL-LABEL: vselect_packss_v16i16:
|
||||||
|
; AVX512VL: # %bb.0:
|
||||||
|
; AVX512VL-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
|
||||||
|
; AVX512VL-NEXT: vpmovzxwd {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero
|
||||||
|
; AVX512VL-NEXT: vpmovdb %zmm0, %xmm0
|
||||||
|
; AVX512VL-NEXT: vpternlogq $202, %xmm3, %xmm2, %xmm0
|
||||||
|
; AVX512VL-NEXT: vzeroupper
|
||||||
|
; AVX512VL-NEXT: retq
|
||||||
;
|
;
|
||||||
; AVX512BWNOVL-LABEL: vselect_packss_v16i16:
|
; AVX512BWNOVL-LABEL: vselect_packss_v16i16:
|
||||||
; AVX512BWNOVL: # %bb.0:
|
; AVX512BWNOVL: # %bb.0:
|
||||||
@ -73,7 +82,7 @@ define <16 x i8> @vselect_packss_v16i16(<16 x i16> %a0, <16 x i16> %a1, <16 x i8
|
|||||||
; AVX512BWVL: # %bb.0:
|
; AVX512BWVL: # %bb.0:
|
||||||
; AVX512BWVL-NEXT: vpcmpeqw %ymm1, %ymm0, %k0
|
; AVX512BWVL-NEXT: vpcmpeqw %ymm1, %ymm0, %k0
|
||||||
; AVX512BWVL-NEXT: vpmovm2b %k0, %xmm0
|
; AVX512BWVL-NEXT: vpmovm2b %k0, %xmm0
|
||||||
; AVX512BWVL-NEXT: vpblendvb %xmm0, %xmm2, %xmm3, %xmm0
|
; AVX512BWVL-NEXT: vpternlogq $202, %xmm3, %xmm2, %xmm0
|
||||||
; AVX512BWVL-NEXT: vzeroupper
|
; AVX512BWVL-NEXT: vzeroupper
|
||||||
; AVX512BWVL-NEXT: retq
|
; AVX512BWVL-NEXT: retq
|
||||||
%1 = icmp eq <16 x i16> %a0, %a1
|
%1 = icmp eq <16 x i16> %a0, %a1
|
||||||
@ -144,14 +153,23 @@ define <16 x i8> @vselect_packss_v16i32(<16 x i32> %a0, <16 x i32> %a1, <16 x i8
|
|||||||
; AVX2-NEXT: vzeroupper
|
; AVX2-NEXT: vzeroupper
|
||||||
; AVX2-NEXT: retq
|
; AVX2-NEXT: retq
|
||||||
;
|
;
|
||||||
; AVX512NOBW-LABEL: vselect_packss_v16i32:
|
; AVX512F-LABEL: vselect_packss_v16i32:
|
||||||
; AVX512NOBW: # %bb.0:
|
; AVX512F: # %bb.0:
|
||||||
; AVX512NOBW-NEXT: vpcmpeqd %zmm1, %zmm0, %k1
|
; AVX512F-NEXT: vpcmpeqd %zmm1, %zmm0, %k1
|
||||||
; AVX512NOBW-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
|
; AVX512F-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
|
||||||
; AVX512NOBW-NEXT: vpmovdb %zmm0, %xmm0
|
; AVX512F-NEXT: vpmovdb %zmm0, %xmm0
|
||||||
; AVX512NOBW-NEXT: vpblendvb %xmm0, %xmm2, %xmm3, %xmm0
|
; AVX512F-NEXT: vpblendvb %xmm0, %xmm2, %xmm3, %xmm0
|
||||||
; AVX512NOBW-NEXT: vzeroupper
|
; AVX512F-NEXT: vzeroupper
|
||||||
; AVX512NOBW-NEXT: retq
|
; AVX512F-NEXT: retq
|
||||||
|
;
|
||||||
|
; AVX512VL-LABEL: vselect_packss_v16i32:
|
||||||
|
; AVX512VL: # %bb.0:
|
||||||
|
; AVX512VL-NEXT: vpcmpeqd %zmm1, %zmm0, %k1
|
||||||
|
; AVX512VL-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
|
||||||
|
; AVX512VL-NEXT: vpmovdb %zmm0, %xmm0
|
||||||
|
; AVX512VL-NEXT: vpternlogq $202, %xmm3, %xmm2, %xmm0
|
||||||
|
; AVX512VL-NEXT: vzeroupper
|
||||||
|
; AVX512VL-NEXT: retq
|
||||||
;
|
;
|
||||||
; AVX512BWNOVL-LABEL: vselect_packss_v16i32:
|
; AVX512BWNOVL-LABEL: vselect_packss_v16i32:
|
||||||
; AVX512BWNOVL: # %bb.0:
|
; AVX512BWNOVL: # %bb.0:
|
||||||
@ -165,7 +183,7 @@ define <16 x i8> @vselect_packss_v16i32(<16 x i32> %a0, <16 x i32> %a1, <16 x i8
|
|||||||
; AVX512BWVL: # %bb.0:
|
; AVX512BWVL: # %bb.0:
|
||||||
; AVX512BWVL-NEXT: vpcmpeqd %zmm1, %zmm0, %k0
|
; AVX512BWVL-NEXT: vpcmpeqd %zmm1, %zmm0, %k0
|
||||||
; AVX512BWVL-NEXT: vpmovm2b %k0, %xmm0
|
; AVX512BWVL-NEXT: vpmovm2b %k0, %xmm0
|
||||||
; AVX512BWVL-NEXT: vpblendvb %xmm0, %xmm2, %xmm3, %xmm0
|
; AVX512BWVL-NEXT: vpternlogq $202, %xmm3, %xmm2, %xmm0
|
||||||
; AVX512BWVL-NEXT: vzeroupper
|
; AVX512BWVL-NEXT: vzeroupper
|
||||||
; AVX512BWVL-NEXT: retq
|
; AVX512BWVL-NEXT: retq
|
||||||
%1 = icmp eq <16 x i32> %a0, %a1
|
%1 = icmp eq <16 x i32> %a0, %a1
|
||||||
@ -292,16 +310,27 @@ define <16 x i8> @vselect_packss_v16i64(<16 x i64> %a0, <16 x i64> %a1, <16 x i8
|
|||||||
; AVX2-NEXT: vzeroupper
|
; AVX2-NEXT: vzeroupper
|
||||||
; AVX2-NEXT: retq
|
; AVX2-NEXT: retq
|
||||||
;
|
;
|
||||||
; AVX512NOBW-LABEL: vselect_packss_v16i64:
|
; AVX512F-LABEL: vselect_packss_v16i64:
|
||||||
; AVX512NOBW: # %bb.0:
|
; AVX512F: # %bb.0:
|
||||||
; AVX512NOBW-NEXT: vpcmpeqq %zmm2, %zmm0, %k0
|
; AVX512F-NEXT: vpcmpeqq %zmm2, %zmm0, %k0
|
||||||
; AVX512NOBW-NEXT: vpcmpeqq %zmm3, %zmm1, %k1
|
; AVX512F-NEXT: vpcmpeqq %zmm3, %zmm1, %k1
|
||||||
; AVX512NOBW-NEXT: kunpckbw %k0, %k1, %k1
|
; AVX512F-NEXT: kunpckbw %k0, %k1, %k1
|
||||||
; AVX512NOBW-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
|
; AVX512F-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
|
||||||
; AVX512NOBW-NEXT: vpmovdb %zmm0, %xmm0
|
; AVX512F-NEXT: vpmovdb %zmm0, %xmm0
|
||||||
; AVX512NOBW-NEXT: vpblendvb %xmm0, %xmm4, %xmm5, %xmm0
|
; AVX512F-NEXT: vpblendvb %xmm0, %xmm4, %xmm5, %xmm0
|
||||||
; AVX512NOBW-NEXT: vzeroupper
|
; AVX512F-NEXT: vzeroupper
|
||||||
; AVX512NOBW-NEXT: retq
|
; AVX512F-NEXT: retq
|
||||||
|
;
|
||||||
|
; AVX512VL-LABEL: vselect_packss_v16i64:
|
||||||
|
; AVX512VL: # %bb.0:
|
||||||
|
; AVX512VL-NEXT: vpcmpeqq %zmm2, %zmm0, %k0
|
||||||
|
; AVX512VL-NEXT: vpcmpeqq %zmm3, %zmm1, %k1
|
||||||
|
; AVX512VL-NEXT: kunpckbw %k0, %k1, %k1
|
||||||
|
; AVX512VL-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
|
||||||
|
; AVX512VL-NEXT: vpmovdb %zmm0, %xmm0
|
||||||
|
; AVX512VL-NEXT: vpternlogq $202, %xmm5, %xmm4, %xmm0
|
||||||
|
; AVX512VL-NEXT: vzeroupper
|
||||||
|
; AVX512VL-NEXT: retq
|
||||||
;
|
;
|
||||||
; AVX512BWNOVL-LABEL: vselect_packss_v16i64:
|
; AVX512BWNOVL-LABEL: vselect_packss_v16i64:
|
||||||
; AVX512BWNOVL: # %bb.0:
|
; AVX512BWNOVL: # %bb.0:
|
||||||
@ -319,7 +348,7 @@ define <16 x i8> @vselect_packss_v16i64(<16 x i64> %a0, <16 x i64> %a1, <16 x i8
|
|||||||
; AVX512BWVL-NEXT: vpcmpeqq %zmm3, %zmm1, %k1
|
; AVX512BWVL-NEXT: vpcmpeqq %zmm3, %zmm1, %k1
|
||||||
; AVX512BWVL-NEXT: kunpckbw %k0, %k1, %k0
|
; AVX512BWVL-NEXT: kunpckbw %k0, %k1, %k0
|
||||||
; AVX512BWVL-NEXT: vpmovm2b %k0, %xmm0
|
; AVX512BWVL-NEXT: vpmovm2b %k0, %xmm0
|
||||||
; AVX512BWVL-NEXT: vpblendvb %xmm0, %xmm4, %xmm5, %xmm0
|
; AVX512BWVL-NEXT: vpternlogq $202, %xmm5, %xmm4, %xmm0
|
||||||
; AVX512BWVL-NEXT: vzeroupper
|
; AVX512BWVL-NEXT: vzeroupper
|
||||||
; AVX512BWVL-NEXT: retq
|
; AVX512BWVL-NEXT: retq
|
||||||
%1 = icmp eq <16 x i64> %a0, %a1
|
%1 = icmp eq <16 x i64> %a0, %a1
|
||||||
@ -375,14 +404,41 @@ define <16 x i8> @vselect_packss(<16 x i16> %a0, <16 x i16> %a1, <16 x i8> %a2,
|
|||||||
; AVX2-NEXT: vzeroupper
|
; AVX2-NEXT: vzeroupper
|
||||||
; AVX2-NEXT: retq
|
; AVX2-NEXT: retq
|
||||||
;
|
;
|
||||||
; AVX512-LABEL: vselect_packss:
|
; AVX512F-LABEL: vselect_packss:
|
||||||
; AVX512: # %bb.0:
|
; AVX512F: # %bb.0:
|
||||||
; AVX512-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
|
; AVX512F-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
|
||||||
; AVX512-NEXT: vextracti128 $1, %ymm0, %xmm1
|
; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
|
||||||
; AVX512-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
|
; AVX512F-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
|
||||||
; AVX512-NEXT: vpblendvb %xmm0, %xmm2, %xmm3, %xmm0
|
; AVX512F-NEXT: vpblendvb %xmm0, %xmm2, %xmm3, %xmm0
|
||||||
; AVX512-NEXT: vzeroupper
|
; AVX512F-NEXT: vzeroupper
|
||||||
; AVX512-NEXT: retq
|
; AVX512F-NEXT: retq
|
||||||
|
;
|
||||||
|
; AVX512VL-LABEL: vselect_packss:
|
||||||
|
; AVX512VL: # %bb.0:
|
||||||
|
; AVX512VL-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
|
||||||
|
; AVX512VL-NEXT: vextracti128 $1, %ymm0, %xmm1
|
||||||
|
; AVX512VL-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
|
||||||
|
; AVX512VL-NEXT: vpternlogq $202, %xmm3, %xmm2, %xmm0
|
||||||
|
; AVX512VL-NEXT: vzeroupper
|
||||||
|
; AVX512VL-NEXT: retq
|
||||||
|
;
|
||||||
|
; AVX512BWNOVL-LABEL: vselect_packss:
|
||||||
|
; AVX512BWNOVL: # %bb.0:
|
||||||
|
; AVX512BWNOVL-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
|
||||||
|
; AVX512BWNOVL-NEXT: vextracti128 $1, %ymm0, %xmm1
|
||||||
|
; AVX512BWNOVL-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
|
||||||
|
; AVX512BWNOVL-NEXT: vpblendvb %xmm0, %xmm2, %xmm3, %xmm0
|
||||||
|
; AVX512BWNOVL-NEXT: vzeroupper
|
||||||
|
; AVX512BWNOVL-NEXT: retq
|
||||||
|
;
|
||||||
|
; AVX512BWVL-LABEL: vselect_packss:
|
||||||
|
; AVX512BWVL: # %bb.0:
|
||||||
|
; AVX512BWVL-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
|
||||||
|
; AVX512BWVL-NEXT: vextracti128 $1, %ymm0, %xmm1
|
||||||
|
; AVX512BWVL-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
|
||||||
|
; AVX512BWVL-NEXT: vpternlogq $202, %xmm3, %xmm2, %xmm0
|
||||||
|
; AVX512BWVL-NEXT: vzeroupper
|
||||||
|
; AVX512BWVL-NEXT: retq
|
||||||
%1 = icmp eq <16 x i16> %a0, %a1
|
%1 = icmp eq <16 x i16> %a0, %a1
|
||||||
%2 = sext <16 x i1> %1 to <16 x i16>
|
%2 = sext <16 x i1> %1 to <16 x i16>
|
||||||
%3 = shufflevector <16 x i16> %2, <16 x i16> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
|
%3 = shufflevector <16 x i16> %2, <16 x i16> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user