Skip to content

Commit eb898cc

Browse files
committed
Address review comments
1 parent 175299b commit eb898cc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5168,7 +5168,7 @@ static bool isCompressMask(ArrayRef<int> Mask) {
51685168
}
51695169
if (SawUndef)
51705170
return false;
5171-
if (i > (unsigned)Mask[i])
5171+
if (i > Mask[i])
51725172
return false;
51735173
if (Mask[i] <= Last)
51745174
return false;
@@ -5399,13 +5399,13 @@ static SDValue lowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG,
53995399
// into them. The mask constants are also smaller than the index vector
54005400
// constants, and thus easier to materialize.
54015401
if (isCompressMask(Mask)) {
5402-
SmallVector<SDValue> MaskVals;
5403-
MaskVals.resize(NumElts, DAG.getConstant(false, DL, XLenVT));
5404-
for (const auto &Idx : enumerate(Mask)) {
5405-
if (Idx.value() == -1)
5402+
SmallVector<SDValue> MaskVals(NumElts,
5403+
DAG.getConstant(false, DL, XLenVT));
5404+
for (auto Idx : Mask) {
5405+
if (Idx == -1)
54065406
break;
5407-
assert(Idx.value() >= 0 && (unsigned)Idx.value() < NumElts);
5408-
MaskVals[Idx.value()] = DAG.getConstant(true, DL, XLenVT);
5407+
assert(Idx >= 0 && (unsigned)Idx < NumElts);
5408+
MaskVals[Idx] = DAG.getConstant(true, DL, XLenVT);
54095409
}
54105410
MVT MaskVT = MVT::getVectorVT(MVT::i1, NumElts);
54115411
SDValue CompressMask = DAG.getBuildVector(MaskVT, DL, MaskVals);

0 commit comments

Comments
 (0)