[Mlir-commits] [mlir] [MLIR] Prevent invalid IR from being passed outside of RemoveDeadValues (PR #121079)
Renat Idrisov
llvmlistbot at llvm.org
Fri Jan 3 13:23:13 PST 2025
================
@@ -588,22 +661,68 @@ static void cleanBranchOp(BranchOpInterface branchOp, RunLivenessAnalysis &la) {
operandValues.push_back(successorOperands[operandIdx]);
}
- BitVector successorLiveOperands = markLives(operandValues, la);
-
// Do (3)
- for (int argIdx = successorLiveOperands.size() - 1; argIdx >= 0; --argIdx) {
- if (!successorLiveOperands[argIdx]) {
- if (successorBlock->getNumArguments() < successorOperands.size()) {
- // if block was cleaned through a different code path
- // we only need to remove operands from the invokation
- successorOperands.erase(argIdx);
- continue;
- }
+ BitVector successorNonLive =
+ markLives(operandValues, nonLiveSet, la).flip();
+ collectNonLiveValues(nonLiveSet, successorBlock->getArguments(),
+ successorNonLive);
+ cl.blocks.push_back({successorBlock, successorNonLive});
+ cl.successorOperands.push_back({branchOp, succIdx, successorNonLive});
+ }
+}
+
+static void cleanUpDeadVals(RDVFinalCleanupList &RDVFinalCleanupList) {
----------------
parsifal-47 wrote:
done, thank you!
https://github.com/llvm/llvm-project/pull/121079
More information about the Mlir-commits
mailing list