summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorEli Friedman <efriedma@codeaurora.org>2016-12-15 22:41:40 +0000
committerEli Friedman <efriedma@codeaurora.org>2016-12-15 22:41:40 +0000
commit379294676dff67faf8f8e2b14b976ff44e62b7df (patch)
tree258b73e2a9800a187f48fc90520ee5d9b8eac45f /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent0bd0fe4e7d3fc3d4c66dc32362c0cde892939600 (diff)
downloadbcm5719-llvm-379294676dff67faf8f8e2b14b976ff44e62b7df.tar.gz
bcm5719-llvm-379294676dff67faf8f8e2b14b976ff44e62b7df.zip
Don't combine splats with other shuffles.
We sometimes end up creating shuffles which are worse than the obvious translation of the IR. Fixes https://llvm.org/bugs/show_bug.cgi?id=31301 . Differential Revision: https://reviews.llvm.org/D27793 llvm-svn: 289882
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 2e9b1e88586..a0f2b63424a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -14377,6 +14377,11 @@ SDValue DAGCombiner::visitVECTOR_SHUFFLE(SDNode *N) {
Level < AfterLegalizeDAG && TLI.isTypeLegal(VT)) {
ShuffleVectorSDNode *OtherSV = cast<ShuffleVectorSDNode>(N0);
+ // Don't try to fold splats; they're likely to simplify somehow, or they
+ // might be free.
+ if (OtherSV->isSplat())
+ return SDValue();
+
// The incoming shuffle must be of the same type as the result of the
// current shuffle.
assert(OtherSV->getOperand(0).getValueType() == VT &&
OpenPOWER on IntegriCloud