Optimize code slightly. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154307 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper 2012-04-09 05:55:33 +00:00
parent 3029a0c56a
commit 4b206bdfd0

View File

@ -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]);