[Mlir-commits] [mlir] [mlir] Add support for staged dataflow analyses (PR #192998)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Wed Apr 22 01:54:24 PDT 2026


================
@@ -110,6 +111,28 @@ Location LatticeAnchor::getLoc() const {
 //===----------------------------------------------------------------------===//
 
 LogicalResult DataFlowSolver::initializeAndRun(Operation *top) {
+  eraseAllStates();
+  return initializeAndRunImpl(top, /*firstAnalysis=*/0);
+}
+
+LogicalResult DataFlowSolver::initializeAndRunPendingAnalyses(Operation *top) {
+  if (hasFailedRun) {
+    return top->emitError("dataflow solver is in a failed state after a "
+                          "previous run; call 'initializeAndRun()' to "
+                          "restart or 'eraseAllStates()' before reusing it");
+  }
+  if (analysisRoot && analysisRoot != top) {
----------------
ftynse wrote:

Why do we even pass in a new `top`? Just reuse the stored one.

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


More information about the Mlir-commits mailing list