summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2018-01-23 15:51:03 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2018-01-23 15:51:03 +0000
commit0c9f77a9f96f5d2368fe2cd2c6c7f7e5c8bf54d6 (patch)
tree73b8aac652adcae86927e43140009e0b1fda0bc4 /llvm/lib
parent347921a28157daf87acfcb31ce4787a46bd7ad12 (diff)
downloadbcm5719-llvm-0c9f77a9f96f5d2368fe2cd2c6c7f7e5c8bf54d6.tar.gz
bcm5719-llvm-0c9f77a9f96f5d2368fe2cd2c6c7f7e5c8bf54d6.zip
[X86][SSE] LowerBUILD_VECTORAsVariablePermute - ensure that the source vector is not larger than the destination
We might be able to support this in the future with VPERMV3, OR(PSHUFB, PSHUFB) etc. llvm-svn: 323210
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 952a937ddef..0e8766b75b5 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -7924,7 +7924,9 @@ LowerBUILD_VECTORAsVariablePermute(SDValue V, SelectionDAG &DAG,
MVT IndicesVT = EVT(VT).changeVectorElementTypeToInteger().getSimpleVT();
IndicesVec = DAG.getZExtOrTrunc(IndicesVec, SDLoc(IndicesVec), IndicesVT);
- if (SrcVec.getValueSizeInBits() < IndicesVT.getSizeInBits()) {
+ if (SrcVec.getValueSizeInBits() > IndicesVT.getSizeInBits())
+ return SDValue();
+ else if (SrcVec.getValueSizeInBits() < IndicesVT.getSizeInBits()) {
SrcVec =
DAG.getNode(ISD::INSERT_SUBVECTOR, SDLoc(SrcVec), VT, DAG.getUNDEF(VT),
SrcVec, DAG.getIntPtrConstant(0, SDLoc(SrcVec)));
OpenPOWER on IntegriCloud