summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2013-08-08 07:38:55 +0000
committerCraig Topper <craig.topper@gmail.com>2013-08-08 07:38:55 +0000
commit309dfefb6f5801968b4bb000b0de01e4c5d6aab2 (patch)
treea8e609e8f751ab6e281681e7be9f6e99ce0331c9 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent2b7b2f373b7275330da97feaacaeb76342470072 (diff)
downloadbcm5719-llvm-309dfefb6f5801968b4bb000b0de01e4c5d6aab2.tar.gz
bcm5719-llvm-309dfefb6f5801968b4bb000b0de01e4c5d6aab2.zip
Optimize mask generation for one of the DAG combiner shufflevector cases.
llvm-svn: 187961
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index cb8894105b1..0d71761fd0f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -9358,10 +9358,10 @@ SDValue DAGCombiner::visitVECTOR_SHUFFLE(SDNode *N) {
for (unsigned i = 0; i != NumElts; ++i) {
int Idx = SVN->getMaskElt(i);
if (Idx >= 0) {
- if (Idx < (int)NumElts)
- Idx += NumElts;
- else
+ if (Idx >= (int)NumElts)
Idx -= NumElts;
+ else
+ Idx = -1; // remove reference to lhs
}
NewMask.push_back(Idx);
}
OpenPOWER on IntegriCloud