[Mlir-commits] [mlir] [mlir] Add support for staged dataflow analyses (PR #192998)
Ivan Butygin
llvmlistbot at llvm.org
Thu Apr 23 08:31:04 PDT 2026
Hardcode84 wrote:
> > > The dependencies in your PR are modeling something slightly different from what this is trying to do. In your PR, dependencies are analyses that need to be loaded at the same time as other analyses, but they do not specify anything about which analyses need to run to a fixpoint before other analyses are initialized. I see the dependencies as a helpful, but orthogonal idea. We could add a new type of dependency that models what this PR is trying to do as a followup, but I think this PR does what we need, and adding the additional dependency-based staged analysis can be a helpful addition later on.
> >
> >
> > The point of my PR was to enable this dependency-based staging in the follow-up and I'd rather didn't have 2 competing APIs for the same thing.
>
> They aren't 2 competing APIs for the same thing. The initializeAndRun is still the entry point, but initializeAndRunPendingAnalyses just provides a way to reuse the solver. The new function does not take a root op as an input, so it cannot be used as a replacement for initializeAndRun. The new API is just additional functionality that enables reuse of the solver and the converged analysis states without needing to spin up a new solver. Hiding everything from the user and handling everything through dependencies does solve the issue of running staged analyses based on known dependencies (assuming the dependencies are defined appropriately, which is not quite the case right now), but it is not a general replacement for the new API. For example, a user of the new API could make arbitrary modifications to the IR in-between stages as long as it does not break any of the assumptions of the completed analyses, which would not be possible with purely the dependency-based staging.
>
> My point is not that we should only have one or the other, but just that the new API is useful in its own right, and the dependency staging can simply added as an improvement to _both_ of the APIs.
Makes sense, I guess. Following your example, what if user need to modify IR between invocations and rerun one analysis, but not all? Maybe instead add ability for dynamically enable/disable individual analyses (or just add optional analysis filter to `initializeAndRun`) instead of monotonic counter? Or maybe better to just have the ability to import lattice state between solvers without moving analyses.
https://github.com/llvm/llvm-project/pull/192998
More information about the Mlir-commits
mailing list