You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[mlir][dataflow] Allow re-run all analyses in DataFlowSolver (llvm#120881)
In downstream (check google/heir#1228,
especially [this
commit](ZenithalHourlyRate/heir@fbf0b27);
also check google/heir#1154) we often need to
re-run the analysis during the transformation pass as IR get changed
based on the analysis result and analysis continuously get invalidated.
There are solutions to it like `getOrCreateState` for newly created
`Value` (`AnchorT`), but warning is that the new state does not
propagate! This is quite unexpected as user of analysis would expect it
to propagate. We downstream used to use `solver->propagateIfChanged` but
that turned out to be not working, see detailed writeup in
google/heir#1153.
Just call `initializeAndRun` repeatedly also does not solve the problem
as `analysisStates` is not cleared and the monotonicity of
`AnalysisState` will make the analysis invalid as `join` will not work
as expected (the first join is no longer `join(uninitialized, init
value)`, instead it becomes `join(higher value, init value)`.
To correctly re-run the analysis, either a new `DataFlowSolver` is
created, or we can just clear the `analysisState`.
0 commit comments