I haven't managed to get this to fail yet but its technically possible for the AND -> shuffle decomposition to result in illegal types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290183
91177308-0d34-0410-b5e6-
96231b3b80d8
: MVT::getIntegerVT(MaskEltSizeInBits);
MaskVT = MVT::getVectorVT(MaskVT, NumMaskElts);
+ // Only allow legal mask types.
+ if (!DAG.getTargetLoweringInfo().isTypeLegal(MaskVT))
+ return false;
+
// Attempt to match the mask against known shuffle patterns.
MVT ShuffleSrcVT, ShuffleVT;
unsigned Shuffle, PermuteImm;