Optimize mask generation for one of the DAG combiner shufflevector cases.

llvm-svn: 187961
This commit is contained in:
Craig Topper 2013-08-08 07:38:55 +00:00
parent e76170ce53
commit 8a5e83ba97

View File

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