@@ -3738,6 +3738,11 @@ static bool scaleShuffleElements(ArrayRef<int> Mask, unsigned NumDstElts,
3738
3738
return false;
3739
3739
}
3740
3740
3741
+ static bool canScaleShuffleElements(ArrayRef<int> Mask, unsigned NumDstElts) {
3742
+ SmallVector<int, 32> ScaledMask;
3743
+ return scaleShuffleElements(Mask, NumDstElts, ScaledMask);
3744
+ }
3745
+
3741
3746
/// Returns true if Elt is a constant zero or a floating point constant +0.0.
3742
3747
bool X86::isZeroNode(SDValue Elt) {
3743
3748
return isNullConstant(Elt) || isNullFPConstant(Elt);
@@ -46684,14 +46689,14 @@ static SDValue combineSetCCMOVMSK(SDValue EFLAGS, X86::CondCode &CC,
46684
46689
// To address this, we check that we can scale the shuffle mask to MOVMSK
46685
46690
// element width (this will ensure "high" elements match). Its slightly overly
46686
46691
// conservative, but fine for an edge case fold.
46687
- SmallVector<int, 32> ShuffleMask, ScaledMaskUnused ;
46692
+ SmallVector<int, 32> ShuffleMask;
46688
46693
SmallVector<SDValue, 2> ShuffleInputs;
46689
46694
if (NumElts <= CmpBits &&
46690
46695
getTargetShuffleInputs(peekThroughBitcasts(Vec), ShuffleInputs,
46691
46696
ShuffleMask, DAG) &&
46692
46697
ShuffleInputs.size() == 1 && isCompletePermute(ShuffleMask) &&
46693
46698
ShuffleInputs[0].getValueSizeInBits() == VecVT.getSizeInBits() &&
46694
- scaleShuffleElements (ShuffleMask, NumElts, ScaledMaskUnused )) {
46699
+ canScaleShuffleElements (ShuffleMask, NumElts)) {
46695
46700
SDLoc DL(EFLAGS);
46696
46701
SDValue Result = DAG.getBitcast(VecVT, ShuffleInputs[0]);
46697
46702
Result = DAG.getNode(X86ISD::MOVMSK, DL, MVT::i32, Result);
0 commit comments