@@ -41694,6 +41694,8 @@ static SDValue combineTargetShuffle(SDValue N, const SDLoc &DL,
41694
41694
TargetLowering::DAGCombinerInfo &DCI,
41695
41695
const X86Subtarget &Subtarget) {
41696
41696
MVT VT = N.getSimpleValueType();
41697
+ unsigned NumElts = VT.getVectorNumElements();
41698
+
41697
41699
SmallVector<int, 4> Mask;
41698
41700
unsigned Opcode = N.getOpcode();
41699
41701
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
@@ -41979,7 +41981,7 @@ static SDValue combineTargetShuffle(SDValue N, const SDLoc &DL,
41979
41981
APInt Mask = APInt::getHighBitsSet(64, 32);
41980
41982
if (DAG.MaskedValueIsZero(In, Mask)) {
41981
41983
SDValue Trunc = DAG.getNode(ISD::TRUNCATE, DL, MVT::i32, In);
41982
- MVT VecVT = MVT::getVectorVT(MVT::i32, VT.getVectorNumElements() * 2);
41984
+ MVT VecVT = MVT::getVectorVT(MVT::i32, NumElts * 2);
41983
41985
SDValue SclVec = DAG.getNode(ISD::SCALAR_TO_VECTOR, DL, VecVT, Trunc);
41984
41986
SDValue Movl = DAG.getNode(X86ISD::VZEXT_MOVL, DL, VecVT, SclVec);
41985
41987
return DAG.getBitcast(VT, Movl);
@@ -41994,7 +41996,6 @@ static SDValue combineTargetShuffle(SDValue N, const SDLoc &DL,
41994
41996
// Create a vector constant - scalar constant followed by zeros.
41995
41997
EVT ScalarVT = N0.getOperand(0).getValueType();
41996
41998
Type *ScalarTy = ScalarVT.getTypeForEVT(*DAG.getContext());
41997
- unsigned NumElts = VT.getVectorNumElements();
41998
41999
Constant *Zero = ConstantInt::getNullValue(ScalarTy);
41999
42000
SmallVector<Constant *, 32> ConstantVec(NumElts, Zero);
42000
42001
ConstantVec[0] = const_cast<ConstantInt *>(C->getConstantIntValue());
@@ -42045,9 +42046,8 @@ static SDValue combineTargetShuffle(SDValue N, const SDLoc &DL,
42045
42046
MVT SrcVT = N0.getOperand(0).getSimpleValueType();
42046
42047
unsigned SrcBits = SrcVT.getScalarSizeInBits();
42047
42048
if ((EltBits % SrcBits) == 0 && SrcBits >= 32) {
42048
- unsigned Size = VT.getVectorNumElements();
42049
42049
unsigned NewSize = SrcVT.getVectorNumElements();
42050
- APInt BlendMask = N.getConstantOperandAPInt(2).zextOrTrunc(Size );
42050
+ APInt BlendMask = N.getConstantOperandAPInt(2).zextOrTrunc(NumElts );
42051
42051
APInt NewBlendMask = APIntOps::ScaleBitMask(BlendMask, NewSize);
42052
42052
return DAG.getBitcast(
42053
42053
VT, DAG.getNode(X86ISD::BLENDI, DL, SrcVT, N0.getOperand(0),
@@ -42460,7 +42460,7 @@ static SDValue combineTargetShuffle(SDValue N, const SDLoc &DL,
42460
42460
int DOffset = N.getOpcode() == X86ISD::PSHUFLW ? 0 : 2;
42461
42461
DMask[DOffset + 0] = DOffset + 1;
42462
42462
DMask[DOffset + 1] = DOffset + 0;
42463
- MVT DVT = MVT::getVectorVT(MVT::i32, VT.getVectorNumElements() / 2);
42463
+ MVT DVT = MVT::getVectorVT(MVT::i32, NumElts / 2);
42464
42464
V = DAG.getBitcast(DVT, V);
42465
42465
V = DAG.getNode(X86ISD::PSHUFD, DL, DVT, V,
42466
42466
getV4X86ShuffleImm8ForMask(DMask, DL, DAG));
0 commit comments