MLIR
18.0.0git
|
Base class for sparse backward data-flow analyses. More...
#include "mlir/Analysis/DataFlow/SparseAnalysis.h"
Public Member Functions | |
LogicalResult | initialize (Operation *top) override |
Initialize the analysis by visiting the operation and everything nested under it. More... | |
LogicalResult | visit (ProgramPoint point) override |
Visit a program point. More... | |
![]() | |
virtual | ~DataFlowAnalysis () |
DataFlowAnalysis (DataFlowSolver &solver) | |
Create an analysis with a reference to the parent solver. More... | |
Protected Member Functions | |
AbstractSparseBackwardDataFlowAnalysis (DataFlowSolver &solver, SymbolTableCollection &symbolTable) | |
virtual void | visitOperationImpl (Operation *op, ArrayRef< AbstractSparseLattice * > operandLattices, ArrayRef< const AbstractSparseLattice * > resultLattices)=0 |
The operation transfer function. More... | |
virtual void | visitBranchOperand (OpOperand &operand)=0 |
virtual void | visitCallOperand (OpOperand &operand)=0 |
virtual void | setToExitState (AbstractSparseLattice *lattice)=0 |
Set the given lattice element(s) at control flow exit point(s). More... | |
void | setAllToExitStates (ArrayRef< AbstractSparseLattice * > lattices) |
Set the given lattice element(s) at control flow exit point(s). More... | |
virtual AbstractSparseLattice * | getLatticeElement (Value value)=0 |
Get the lattice element for a value. More... | |
SmallVector< AbstractSparseLattice * > | getLatticeElements (ValueRange values) |
Get the lattice elements for a range of values. More... | |
void | meet (AbstractSparseLattice *lhs, const AbstractSparseLattice &rhs) |
Join the lattice element and propagate and update if it changed. More... | |
![]() | |
void | addDependency (AnalysisState *state, ProgramPoint point) |
Create a dependency between the given analysis state and program point on this analysis. More... | |
void | propagateIfChanged (AnalysisState *state, ChangeResult changed) |
Propagate an update to a state if it changed. More... | |
template<typename PointT > | |
void | registerPointKind () |
Register a custom program point class. More... | |
template<typename PointT , typename... Args> | |
PointT * | getProgramPoint (Args &&...args) |
Get or create a custom program point. More... | |
template<typename StateT , typename PointT > | |
StateT * | getOrCreate (PointT point) |
Get the analysis state associated with the program point. More... | |
template<typename StateT , typename PointT > | |
const StateT * | getOrCreateFor (ProgramPoint dependent, PointT point) |
Get a read-only analysis state for the given point and create a dependency on dependent . More... | |
Base class for sparse backward data-flow analyses.
Similar to AbstractSparseForwardDataFlowAnalysis, but walks bottom to top.
Definition at line 345 of file SparseAnalysis.h.
|
explicitprotected |
Definition at line 305 of file SparseAnalysis.cpp.
|
protectedpure virtual |
Get the lattice element for a value.
Implemented in mlir::dataflow::SparseBackwardDataFlowAnalysis< StateT >, and mlir::dataflow::SparseBackwardDataFlowAnalysis< Liveness >.
Referenced by getLatticeElements().
|
protected |
Get the lattice elements for a range of values.
Definition at line 349 of file SparseAnalysis.cpp.
References getLatticeElement().
|
overridevirtual |
Initialize the analysis by visiting the operation and everything nested under it.
Implements mlir::DataFlowAnalysis.
Definition at line 312 of file SparseAnalysis.cpp.
|
protected |
Join the lattice element and propagate and update if it changed.
Definition at line 579 of file SparseAnalysis.cpp.
References mlir::dataflow::AbstractSparseLattice::meet(), and mlir::DataFlowAnalysis::propagateIfChanged().
|
protected |
Set the given lattice element(s) at control flow exit point(s).
Definition at line 573 of file SparseAnalysis.cpp.
References setToExitState().
Referenced by mlir::dataflow::SparseBackwardDataFlowAnalysis< StateT >::setAllToExitStates().
|
protectedpure virtual |
Set the given lattice element(s) at control flow exit point(s).
Implemented in mlir::dataflow::SparseBackwardDataFlowAnalysis< StateT >, and mlir::dataflow::SparseBackwardDataFlowAnalysis< Liveness >.
Referenced by setAllToExitStates().
|
overridevirtual |
Visit a program point.
If this is a call operation or an operation with block or region control-flow, then operand lattices are set accordingly. Otherwise, invokes the operation transfer function (visitOperationImpl
).
Implements mlir::DataFlowAnalysis.
Definition at line 334 of file SparseAnalysis.cpp.
|
protectedpure virtual |
Implemented in mlir::dataflow::LivenessAnalysis.
|
protectedpure virtual |
Implemented in mlir::dataflow::LivenessAnalysis.
|
protectedpure virtual |
The operation transfer function.
Given the result lattices, this function is expected to set the operand lattices.