Skip to content

Commit 4b0a367

Browse files
committed
Use range based for loop. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288671 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 447a288 commit 4b0a367

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lib/Target/X86/X86ISelLowering.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27396,13 +27396,10 @@ static SDValue combineShuffleOfConcatUndef(SDNode *N, SelectionDAG &DAG,
2739627396
// index, but elements from the second source no longer need to skip an undef.
2739727397
SmallVector<int, 8> Mask;
2739827398
int NumElts = VT.getVectorNumElements();
27399-
for (int i = 0; i < NumElts; ++i) {
27400-
int Elt = cast<ShuffleVectorSDNode>(N)->getMaskElt(i);
27401-
if (Elt < NumElts)
27402-
Mask.push_back(Elt);
27403-
else
27404-
Mask.push_back(Elt - NumElts / 2);
27405-
}
27399+
27400+
ShuffleVectorSDNode *SVOp = cast<ShuffleVectorSDNode>(N);
27401+
for (int Elt : SVOp->getMask())
27402+
Mask.push_back(Elt < NumElts ? Elt : (Elt - NumElts / 2));
2740627403

2740727404
SDLoc DL(N);
2740827405
SDValue Concat = DAG.getNode(ISD::CONCAT_VECTORS, DL, VT, N0.getOperand(0),

0 commit comments

Comments
 (0)