[Mlir-commits] [mlir] [mlir][dataflow] Add visitBranchRegionArgument interface to SparseBackwardDataFlowAnalysis and apply it in LivenessAnalysis/RemoveDeadValues (PR #169816)

lonely eagle llvmlistbot at llvm.org
Thu Nov 27 22:27:29 PST 2025


================
@@ -609,12 +609,24 @@ void AbstractSparseBackwardDataFlowAnalysis::visitRegionSuccessors(
            *getLatticeElementFor(getProgramPointAfter(op), input));
       unaccounted.reset(operand.getOperandNumber());
     }
+
+    if (successor.isParent())
+      continue;
+    auto arguments = successor.getSuccessor()->getArguments();
+    for (BlockArgument argument : arguments) {
+      if (llvm::find(inputs, argument) == inputs.end()) {
----------------
linuxlonelyeagle wrote:

It seems that the current data flow analysis framework only accesses the operands of region op, and does not access its inits/regionIters and iv for affine.for or scf.for. IV is slightly different for inits/regionIters to me, as it is a property. I think we need a way to access this SSA value.

https://github.com/llvm/llvm-project/pull/169816


More information about the Mlir-commits mailing list