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

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Wed Apr 22 01:54:25 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) {
+    return top->emitError("dataflow solver can only be resumed with the same "
+                          "top-level operation used for the original run");
+  }
----------------
ftynse wrote:

These are assertions, not diagnostics, as they reflect an error in the dataflow setup, not a problem with user input.

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


More information about the Mlir-commits mailing list