[X86] Constant fold KSHIFT of an all zeros vector to just an all zeros vector.

This commit is contained in:
Craig Topper 2019-12-31 15:57:17 -08:00
parent 374e0299cf
commit 26bdc603f7
2 changed files with 3 additions and 12 deletions

View File

@ -45722,6 +45722,9 @@ static SDValue combineKSHIFT(SDNode *N, SelectionDAG &DAG,
TargetLowering::DAGCombinerInfo &DCI) {
EVT VT = N->getValueType(0);
if (ISD::isBuildVectorAllZeros(N->getOperand(0).getNode()))
return DAG.getConstant(0, SDLoc(N), VT);
APInt KnownUndef, KnownZero;
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
APInt DemandedElts = APInt::getAllOnesValue(VT.getVectorNumElements());

View File

@ -4915,10 +4915,6 @@ define void @widen_masked_store(<3 x i32> %v, <3 x i32>* %p, <3 x i1> %mask) {
; AVX512F-NEXT: ## kill: def $xmm0 killed $xmm0 def $zmm0
; AVX512F-NEXT: andl $1, %esi
; AVX512F-NEXT: kmovw %esi, %k0
; AVX512F-NEXT: kxorw %k0, %k0, %k1
; AVX512F-NEXT: kshiftrw $1, %k1, %k1
; AVX512F-NEXT: kshiftlw $1, %k1, %k1
; AVX512F-NEXT: korw %k0, %k1, %k0
; AVX512F-NEXT: kshiftrw $2, %k0, %k1
; AVX512F-NEXT: kshiftlw $2, %k1, %k1
; AVX512F-NEXT: kshiftlw $15, %k0, %k0
@ -4948,10 +4944,6 @@ define void @widen_masked_store(<3 x i32> %v, <3 x i32>* %p, <3 x i1> %mask) {
; AVX512VLDQ-NEXT: kmovw %esi, %k0
; AVX512VLDQ-NEXT: kshiftlb $7, %k0, %k0
; AVX512VLDQ-NEXT: kshiftrb $7, %k0, %k0
; AVX512VLDQ-NEXT: kxorw %k0, %k0, %k1
; AVX512VLDQ-NEXT: kshiftrb $1, %k1, %k1
; AVX512VLDQ-NEXT: kshiftlb $1, %k1, %k1
; AVX512VLDQ-NEXT: korb %k0, %k1, %k0
; AVX512VLDQ-NEXT: kshiftrb $2, %k0, %k1
; AVX512VLDQ-NEXT: kshiftlb $2, %k1, %k1
; AVX512VLDQ-NEXT: kshiftlb $7, %k0, %k0
@ -4977,10 +4969,6 @@ define void @widen_masked_store(<3 x i32> %v, <3 x i32>* %p, <3 x i1> %mask) {
; AVX512VLBW: ## %bb.0:
; AVX512VLBW-NEXT: andl $1, %esi
; AVX512VLBW-NEXT: kmovw %esi, %k0
; AVX512VLBW-NEXT: kxorw %k0, %k0, %k1
; AVX512VLBW-NEXT: kshiftrw $1, %k1, %k1
; AVX512VLBW-NEXT: kshiftlw $1, %k1, %k1
; AVX512VLBW-NEXT: korw %k0, %k1, %k0
; AVX512VLBW-NEXT: kshiftrw $2, %k0, %k1
; AVX512VLBW-NEXT: kshiftlw $2, %k1, %k1
; AVX512VLBW-NEXT: kshiftlw $15, %k0, %k0