[X86][SSE] Ensure we're only combining shuffles with legal mask types.

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
This commit is contained in:
Simon Pilgrim 2016-12-20 17:09:52 +00:00
parent 11d071bf72
commit 5624de7d8d

View File

@ -26460,6 +26460,10 @@ static bool combineX86ShuffleChain(ArrayRef<SDValue> Inputs, SDValue Root,
: 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;