summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2012-03-19 15:35:44 +0000
committerDuncan Sands <baldrick@free.fr>2012-03-19 15:35:44 +0000
commit3fb2fc6edb5d7d90694597b35116ba56deec9cc6 (patch)
tree63a460105a034c8ab90add45b0cdd2ed56e11434 /llvm/lib/CodeGen
parent8935578528f6ba085064f6570784d544501e5737 (diff)
downloadbcm5719-llvm-3fb2fc6edb5d7d90694597b35116ba56deec9cc6.tar.gz
bcm5719-llvm-3fb2fc6edb5d7d90694597b35116ba56deec9cc6.zip
Fix DAG combine which creates illegal vector shuffles. Patch by Heikki Kultala.
llvm-svn: 153035
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 32b9fa4ec35..1bd1b95ad7d 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -7473,6 +7473,12 @@ SDValue DAGCombiner::visitBUILD_VECTOR(SDNode *N) {
// Check to see if this is a BUILD_VECTOR of a bunch of EXTRACT_VECTOR_ELT
// operations. If so, and if the EXTRACT_VECTOR_ELT vector inputs come from
// at most two distinct vectors, turn this into a shuffle node.
+
+ // May only combine to shuffle after legalize if shuffle is legal.
+ if (LegalOperations &&
+ !TLI.isOperationLegalOrCustom(ISD::VECTOR_SHUFFLE, VT))
+ return SDValue();
+
SDValue VecIn1, VecIn2;
for (unsigned i = 0; i != NumInScalars; ++i) {
// Ignore undef inputs.
OpenPOWER on IntegriCloud