diff options
author | Craig Topper <craig.topper@gmail.com> | 2013-08-08 07:38:55 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2013-08-08 07:38:55 +0000 |
commit | 01d22aaa78b831ad4837f928e0554be7e65addaa (patch) | |
tree | f58a4bf1b247e302455d29612f29f66403d3914c | |
parent | 05a4d2642b415e3332651733015b656bc3c7b9bc (diff) | |
download | external_llvm-01d22aaa78b831ad4837f928e0554be7e65addaa.zip external_llvm-01d22aaa78b831ad4837f928e0554be7e65addaa.tar.gz external_llvm-01d22aaa78b831ad4837f928e0554be7e65addaa.tar.bz2 |
Optimize mask generation for one of the DAG combiner shufflevector cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187961 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index cb88941..0d71761 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/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); } |