summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2012-04-09 05:55:33 +0000
committerCraig Topper <craig.topper@gmail.com>2012-04-09 05:55:33 +0000
commite3ad4834ae9d911e4a75a90517d0dd7da3f74758 (patch)
tree13f4066afa66e57902b82b7a01c4fdcd8920047b
parent8a49d049e17b1e0916aa4c1b662444b4b6da3405 (diff)
downloadbcm5719-llvm-e3ad4834ae9d911e4a75a90517d0dd7da3f74758.tar.gz
bcm5719-llvm-e3ad4834ae9d911e4a75a90517d0dd7da3f74758.zip
Optimize code slightly. No functionality change.
llvm-svn: 154307
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 036f0392a03..a910e34579e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -7723,12 +7723,13 @@ SDValue DAGCombiner::visitVECTOR_SHUFFLE(SDNode *N) {
SmallVector<int, 8> NewMask;
for (unsigned i = 0; i != NumElts; ++i) {
int Idx = SVN->getMaskElt(i);
- if (Idx < 0)
- NewMask.push_back(Idx);
- else if (Idx < (int)NumElts)
- NewMask.push_back(Idx + NumElts);
- else
- NewMask.push_back(Idx - NumElts);
+ if (Idx >= 0) {
+ if (Idx < (int)NumElts)
+ Idx += NumElts;
+ else
+ Idx -= NumElts;
+ }
+ NewMask.push_back(Idx);
}
return DAG.getVectorShuffle(VT, N->getDebugLoc(), N1, DAG.getUNDEF(VT),
&NewMask[0]);
OpenPOWER on IntegriCloud