MLIR
19.0.0git
|
Base class for generic analysis states. More...
#include "mlir/Analysis/DataFlowFramework.h"
Public Member Functions | |
virtual | ~AnalysisState () |
AnalysisState (ProgramPoint point) | |
Create the analysis state at the given program point. More... | |
ProgramPoint | getPoint () const |
Returns the program point this state is located at. More... | |
virtual void | print (raw_ostream &os) const =0 |
Print the contents of the analysis state. More... | |
LLVM_DUMP_METHOD void | dump () const |
void | addDependency (ProgramPoint dependent, DataFlowAnalysis *analysis) |
Add a dependency to this analysis state on a program point and an analysis. More... | |
Protected Member Functions | |
virtual void | onUpdate (DataFlowSolver *solver) const |
This function is called by the solver when the analysis state is updated to enqueue more work items. More... | |
Protected Attributes | |
ProgramPoint | point |
The program point to which the state belongs. More... | |
Friends | |
class | DataFlowSolver |
Allow the framework to access the dependents. More... | |
Base class for generic analysis states.
Analysis states contain data-flow information that are attached to program points and which evolve as the analysis iterates.
This class places no restrictions on the semantics of analysis states beyond these requirements.
Definition at line 314 of file DataFlowFramework.h.
|
virtualdefault |
|
inline |
Create the analysis state at the given program point.
Definition at line 319 of file DataFlowFramework.h.
void AnalysisState::addDependency | ( | ProgramPoint | dependent, |
DataFlowAnalysis * | analysis | ||
) |
Add a dependency to this analysis state on a program point and an analysis.
If this state is updated, the analysis will be invoked on the given program point again (in onUpdate()).
Definition at line 41 of file DataFlowFramework.cpp.
References DATAFLOW_DEBUG, and point.
void AnalysisState::dump | ( | ) | const |
Definition at line 54 of file DataFlowFramework.cpp.
References print().
|
inline |
Returns the program point this state is located at.
Definition at line 322 of file DataFlowFramework.h.
References point.
Referenced by mlir::dataflow::AbstractSparseLattice::getPoint().
|
inlineprotectedvirtual |
This function is called by the solver when the analysis state is updated to enqueue more work items.
For example, if a state tracks dependents through the IR (e.g. use-def chains), this function can be implemented to push those dependents on the worklist.
Reimplemented in mlir::dataflow::AbstractSparseLattice, mlir::dataflow::IntegerValueRangeLattice, and mlir::dataflow::Executable.
Definition at line 338 of file DataFlowFramework.h.
References mlir::DataFlowSolver::enqueue().
Referenced by mlir::dataflow::Executable::onUpdate(), and mlir::dataflow::AbstractSparseLattice::onUpdate().
|
pure virtual |
Print the contents of the analysis state.
Implemented in mlir::dataflow::Lattice< ValueT >, mlir::dataflow::Lattice< IntegerValueRange >, mlir::dataflow::Liveness, mlir::dataflow::PredecessorState, and mlir::dataflow::Executable.
Referenced by dump().
|
friend |
Allow the framework to access the dependents.
Definition at line 364 of file DataFlowFramework.h.
|
protected |
The program point to which the state belongs.
Definition at line 344 of file DataFlowFramework.h.
Referenced by addDependency(), mlir::dataflow::Lattice< ValueT >::getPoint(), getPoint(), mlir::dataflow::Executable::onUpdate(), mlir::dataflow::IntegerValueRangeLattice::onUpdate(), and mlir::dataflow::AbstractSparseLattice::onUpdate().