Skip to content

Commit 78ae4f1

Browse files
Update mlir/lib/Transforms/RemoveDeadValues.cpp with joker-eph suggestion
Co-authored-by: Mehdi Amini <[email protected]>
1 parent 664802a commit 78ae4f1

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

mlir/lib/Transforms/RemoveDeadValues.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -785,14 +785,11 @@ static void cleanUpDeadVals(RDVFinalCleanupList &list) {
785785
// AttrSizedOperandSegments).
786786
if (o.nonLive.any()) {
787787
// Map the argument logical index to the operand number(s) recorded.
788-
SmallVector<OpOperand *> callOperands =
789-
operandsToOpOperands(call.getArgOperands());
788+
int operandOffset = call.getArgOperands().getBeginOperandIndex();
790789
for (int argIdx : deadArgIdxs.set_bits()) {
791-
if (argIdx < static_cast<int>(callOperands.size())) {
792-
unsigned operandNumber = callOperands[argIdx]->getOperandNumber();
793-
if (operandNumber < o.nonLive.size())
794-
o.nonLive.reset(operandNumber);
795-
}
790+
int operandNumber = operandOffset + argIdx;
791+
if (operandNumber < o.nonLive.size())
792+
o.nonLive.reset(operandNumber);
796793
}
797794
}
798795
}

0 commit comments

Comments
 (0)