diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2016-12-20 17:09:52 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2016-12-20 17:09:52 +0000 |
| commit | 688114d888db0616f02caedbf0e94bad6a473512 (patch) | |
| tree | 2347ccd4810d526259ac4723f2aa0c27e18e8d9e | |
| parent | a7206b9e097cd403c3e53ada214b8bbfaca9449b (diff) | |
| download | bcm5719-llvm-688114d888db0616f02caedbf0e94bad6a473512.tar.gz bcm5719-llvm-688114d888db0616f02caedbf0e94bad6a473512.zip | |
[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.
llvm-svn: 290183
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 1470952f176..a2eb654bcd2 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -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; |

