Use range based for loop. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288671 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Simon Pilgrim 2016-12-05 14:25:04 +00:00
parent 447a2882e2
commit 4b0a367e90

View File

@ -27396,13 +27396,10 @@ static SDValue combineShuffleOfConcatUndef(SDNode *N, SelectionDAG &DAG,
// index, but elements from the second source no longer need to skip an undef.
SmallVector<int, 8> Mask;
int NumElts = VT.getVectorNumElements();
for (int i = 0; i < NumElts; ++i) {
int Elt = cast<ShuffleVectorSDNode>(N)->getMaskElt(i);
if (Elt < NumElts)
Mask.push_back(Elt);
else
Mask.push_back(Elt - NumElts / 2);
}
ShuffleVectorSDNode *SVOp = cast<ShuffleVectorSDNode>(N);
for (int Elt : SVOp->getMask())
Mask.push_back(Elt < NumElts ? Elt : (Elt - NumElts / 2));
SDLoc DL(N);
SDValue Concat = DAG.getNode(ISD::CONCAT_VECTORS, DL, VT, N0.getOperand(0),