summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2012-09-10 14:01:21 +0000
committerJames Molloy <james.molloy@arm.com>2012-09-10 14:01:21 +0000
commit8cd08bf4ac67b9d711fd1f72e6f5e00425d8c6ad (patch)
tree929d49c75823f91b9992bc4a92e0111356c982bd /lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parentff1b63172d22c148c9180a546262f61a8c334974 (diff)
downloadllvm-8cd08bf4ac67b9d711fd1f72e6f5e00425d8c6ad.tar.gz
llvm-8cd08bf4ac67b9d711fd1f72e6f5e00425d8c6ad.tar.bz2
llvm-8cd08bf4ac67b9d711fd1f72e6f5e00425d8c6ad.tar.xz
Fix an assertion failure when optimising a shufflevector incorrectly into concat_vectors, and a followup bug with SelectionDAG::getNode() creating nodes with invalid types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163511 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 4caafa5b57..d7fa00962a 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -8095,6 +8095,12 @@ SDValue DAGCombiner::visitBUILD_VECTOR(SDNode *N) {
if (VecIn1.getValueType().getSizeInBits()*2 != VT.getSizeInBits())
return SDValue();
+ // If the input vector type has a different base type to the output
+ // vector type, bail out.
+ if (VecIn1.getValueType().getVectorElementType() !=
+ VT.getVectorElementType())
+ return SDValue();
+
// Widen the input vector by adding undef values.
VecIn1 = DAG.getNode(ISD::CONCAT_VECTORS, N->getDebugLoc(), VT,
VecIn1, DAG.getUNDEF(VecIn1.getValueType()));