1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

Optimize code slightly. No functionality change.

llvm-svn: 154307
This commit is contained in:
Craig Topper 2012-04-09 05:55:33 +00:00
parent adcb1f1d29
commit ee38217fe4

View File

@ -7723,12 +7723,13 @@ SDValue DAGCombiner::visitVECTOR_SHUFFLE(SDNode *N) {
SmallVector<int, 8> NewMask; SmallVector<int, 8> NewMask;
for (unsigned i = 0; i != NumElts; ++i) { for (unsigned i = 0; i != NumElts; ++i) {
int Idx = SVN->getMaskElt(i); int Idx = SVN->getMaskElt(i);
if (Idx < 0) if (Idx >= 0) {
NewMask.push_back(Idx); if (Idx < (int)NumElts)
else if (Idx < (int)NumElts) Idx += NumElts;
NewMask.push_back(Idx + NumElts);
else else
NewMask.push_back(Idx - NumElts); Idx -= NumElts;
}
NewMask.push_back(Idx);
} }
return DAG.getVectorShuffle(VT, N->getDebugLoc(), N1, DAG.getUNDEF(VT), return DAG.getVectorShuffle(VT, N->getDebugLoc(), N1, DAG.getUNDEF(VT),
&NewMask[0]); &NewMask[0]);