[Mlir-commits] [mlir] [mlir][dataflow] Fix LivenessAnalysis/RemoveDeadValues handling of loop induction variables (PR #161117)

Mehdi Amini llvmlistbot at llvm.org
Mon Oct 20 07:57:31 PDT 2025


================
@@ -309,15 +310,29 @@ RunLivenessAnalysis::RunLivenessAnalysis(Operation *op) {
              << " has no liveness info (unreachable), mark dead";
       solver.getOrCreateState<Liveness>(result.value());
     }
+    SmallVector<Value> mustLiveValues;
+    if (auto loopOp = dyn_cast<LoopLikeOpInterface>(op)) {
----------------
joker-eph wrote:

I looked into it, the issue is that Liveness is understanding this interface, and we need RemoveDeadValues to be in sync with Liveness here.
If an operation does not have the interface, then the value wouldn't be marked dead by Liveness analysis.

So using the interface is the right fix.

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


More information about the Mlir-commits mailing list