Skip to content

[mlir][dataflow] Allow re-run all analyses in DataFlowSolver #120881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions mlir/include/mlir/Analysis/DataFlowFramework.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ class DataFlowConfig {
/// according to their dependency relations until a fixed point is reached.
/// 3. Query analysis state results from the solver.
///
/// Steps to re-run a data-flow analysis when IR changes:
/// 1. Erase all analysis states as they are no longer valid.
/// 2. Re-run the analysis using `initializeAndRun`.
///
/// TODO: Optimize the internal implementation of the solver.
class DataFlowSolver {
public:
Expand Down Expand Up @@ -346,6 +350,9 @@ class DataFlowSolver {
}
}

// Erase all analysis states
void eraseAllStates() { analysisStates.clear(); }

/// Get a uniqued lattice anchor instance. If one is not present, it is
/// created with the provided arguments.
template <typename AnchorT, typename... Args>
Expand Down
Loading