Skip to content

Commit 2896bbe

Browse files
committed
[X86] getFauxShuffleMask - use std::iota for insert_subvector shuffle mask population. NFC.
1 parent a6edaeb commit 2896bbe

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6180,7 +6180,7 @@ static bool getFauxShuffleMask(SDValue N, const APInt &DemandedElts,
61806180
uint64_t InsertIdx = N.getConstantOperandVal(2);
61816181
// Subvector isn't demanded - just return the base vector.
61826182
if (DemandedElts.extractBits(NumSubElts, InsertIdx) == 0) {
6183-
Mask.resize(NumElts, SM_SentinelUndef);
6183+
Mask.resize(NumElts);
61846184
std::iota(Mask.begin(), Mask.end(), 0);
61856185
Ops.push_back(Src);
61866186
return true;
@@ -6194,10 +6194,9 @@ static bool getFauxShuffleMask(SDValue N, const APInt &DemandedElts,
61946194
Src.getConstantOperandVal(2) == 0 &&
61956195
(NumBitsPerElt == 64 || Src.getOperand(1) == Sub) &&
61966196
SDNode::areOnlyUsersOf({N.getNode(), Src.getNode()}, Sub.getNode())) {
6197-
for (int i = 0; i != (int)NumSubElts; ++i)
6198-
Mask.push_back(i);
6199-
for (int i = 0; i != (int)NumSubElts; ++i)
6200-
Mask.push_back(i + NumElts);
6197+
Mask.resize(NumElts);
6198+
std::iota(Mask.begin(), Mask.begin() + NumSubElts, 0);
6199+
std::iota(Mask.begin() + NumSubElts, Mask.end(), NumElts);
62016200
Ops.push_back(Src.getOperand(1));
62026201
Ops.push_back(Sub);
62036202
return true;

0 commit comments

Comments
 (0)