|
MLIR 22.0.0git
|
Base class for generic analysis states. More...
#include "mlir/Analysis/DataFlowFramework.h"
Public Member Functions | |
| virtual | ~AnalysisState () |
| AnalysisState (LatticeAnchor anchor) | |
| Create the analysis state on the given lattice anchor. | |
| LatticeAnchor | getAnchor () const |
| Returns the lattice anchor this state is located at. | |
| virtual void | print (raw_ostream &os) const =0 |
| Print the contents of the analysis state. | |
| LLVM_DUMP_METHOD void | dump () const |
| void | addDependency (ProgramPoint *point, DataFlowAnalysis *analysis) |
| Add a dependency to this analysis state on a lattice anchor and an analysis. | |
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. | |
Protected Attributes | |
| LatticeAnchor | anchor |
| The lattice anchor to which the state belongs. | |
Friends | |
| class | DataFlowSolver |
| Allow the framework to access the dependents. | |
Base class for generic analysis states.
Analysis states contain data-flow information that are attached to lattice anchors and which evolve as the analysis iterates.
This class places no restrictions on the semantics of analysis states beyond these requirements.
Definition at line 488 of file DataFlowFramework.h.
|
virtualdefault |
|
inline |
Create the analysis state on the given lattice anchor.
Definition at line 493 of file DataFlowFramework.h.
References anchor.
Referenced by mlir::dataflow::AbstractSparseLattice::AbstractSparseLattice(), mlir::bufferization::OneShotAnalysisState::classof(), and mlir::bufferization::OneShotAnalysisState::OneShotAnalysisState().
| void AnalysisState::addDependency | ( | ProgramPoint * | point, |
| DataFlowAnalysis * | analysis ) |
Add a dependency to this analysis state on a lattice anchor and an analysis.
If this state is updated, the analysis will be invoked on the given lattice anchor again (in onUpdate()).
Definition at line 42 of file DataFlowFramework.cpp.
References anchor, DATAFLOW_DEBUG, and inserted().
Referenced by mlir::DataFlowAnalysis::addDependency().
| void AnalysisState::dump | ( | ) | const |
Definition at line 54 of file DataFlowFramework.cpp.
References print().
|
inline |
Returns the lattice anchor this state is located at.
Definition at line 496 of file DataFlowFramework.h.
References anchor.
Referenced by mlir::dataflow::AbstractSparseLattice::getAnchor().
|
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::Executable, and mlir::dataflow::IntegerValueRangeLattice.
Definition at line 512 of file DataFlowFramework.h.
References DataFlowSolver, and mlir::DataFlowSolver::enqueue().
Referenced by mlir::dataflow::AbstractSparseLattice::onUpdate(), mlir::dataflow::Executable::onUpdate(), and mlir::DataFlowSolver::propagateIfChanged().
|
pure virtual |
Print the contents of the analysis state.
Implemented in mlir::dataflow::Lattice< ValueT >, mlir::dataflow::Lattice< IntegerValueRange >, and mlir::dataflow::Lattice< StridedMetadataRange >.
Referenced by dump(), and mlir::operator<<().
|
friend |
Allow the framework to access the dependents.
Definition at line 538 of file DataFlowFramework.h.
References DataFlowSolver.
Referenced by DataFlowSolver, onUpdate(), mlir::dataflow::AbstractSparseLattice::onUpdate(), mlir::dataflow::Executable::onUpdate(), and mlir::dataflow::IntegerValueRangeLattice::onUpdate().
|
protected |
The lattice anchor to which the state belongs.
Definition at line 518 of file DataFlowFramework.h.
Referenced by addDependency(), AnalysisState(), getAnchor(), mlir::dataflow::Lattice< ValueT >::getAnchor(), mlir::dataflow::AbstractSparseLattice::onUpdate(), mlir::dataflow::Executable::onUpdate(), mlir::dataflow::IntegerValueRangeLattice::onUpdate(), and mlir::DataFlowSolver::propagateIfChanged().