[Mlir-commits] [mlir] [mlir][dataflow] Add visitBranchRegionArgument interface to SparseBackwardDataFlowAnalysis and apply it in LivenessAnalysis/RemoveDeadValues (PR #169816)
Oleksandr Alex Zinenko
llvmlistbot at llvm.org
Thu Dec 18 00:35:38 PST 2025
https://github.com/ftynse requested changes to this pull request.
I think I understand the underlying problem, but it took me a while. Please make sure to correctly describe it in the commit message so reviewers don't have to infer it from changes. The problem, as I understand it, lies in the fact that the logic updating the liveness of block arguments is currently located in `visitBranchOperand`, which is called for non-forwarded operands of a (region) branch operation. If this operation has no operands, like an `affine.if`, `visitBranchOperand` is never called, and thus the liveness lattices of block arguments are never updated. This can be confirmed by adding `iter_args` to the `affine.for`, at which point I expect the IV to become live right now.
The fix is to move this logic to a dedicated function that gets called for block arguments that are not forwarded to. This sounds correct. But I think we still need to handle the operands as well, which this patch removes, and we don't seem to have a test for that.
https://github.com/llvm/llvm-project/pull/169816
More information about the Mlir-commits
mailing list