MLIR
18.0.0git
|
A sparse (backward) data-flow analysis for propagating SSA value lattices backwards across the IR by implementing transfer functions for operations. More...
#include "mlir/Analysis/DataFlow/SparseAnalysis.h"
Public Member Functions | |
SparseBackwardDataFlowAnalysis (DataFlowSolver &solver, SymbolTableCollection &symbolTable) | |
virtual void | visitOperation (Operation *op, ArrayRef< StateT * > operands, ArrayRef< const StateT * > results)=0 |
Visit an operation with the lattices of its results. More... | |
![]() | |
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 | |
StateT * | getLatticeElement (Value value) override |
Get the lattice element for a value. More... | |
virtual void | setToExitState (StateT *lattice)=0 |
Set the given lattice element(s) at control flow exit point(s). More... | |
void | setToExitState (AbstractSparseLattice *lattice) override |
Set the given lattice element(s) at control flow exit point(s). More... | |
void | setAllToExitStates (ArrayRef< StateT * > lattices) |
![]() | |
AbstractSparseBackwardDataFlowAnalysis (DataFlowSolver &solver, SymbolTableCollection &symbolTable) | |
virtual void | visitBranchOperand (OpOperand &operand)=0 |
virtual void | visitCallOperand (OpOperand &operand)=0 |
void | setAllToExitStates (ArrayRef< AbstractSparseLattice * > lattices) |
Set the given lattice element(s) at control flow exit point(s). 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... | |
A sparse (backward) data-flow analysis for propagating SSA value lattices backwards across the IR by implementing transfer functions for operations.
StateT
is expected to be a subclass of AbstractSparseLattice
.
Definition at line 435 of file SparseAnalysis.h.
|
inlineexplicit |
Definition at line 438 of file SparseAnalysis.h.
|
inlineoverrideprotectedvirtual |
Get the lattice element for a value.
Implements mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis.
Definition at line 449 of file SparseAnalysis.h.
|
inlineprotected |
Definition at line 458 of file SparseAnalysis.h.
References mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::setAllToExitStates().
|
inlineoverrideprotectedvirtual |
Set the given lattice element(s) at control flow exit point(s).
Implements mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis.
Definition at line 455 of file SparseAnalysis.h.
References mlir::dataflow::SparseBackwardDataFlowAnalysis< StateT >::setToExitState().
|
protectedpure virtual |
Set the given lattice element(s) at control flow exit point(s).
Implemented in mlir::dataflow::LivenessAnalysis.
Referenced by mlir::dataflow::SparseBackwardDataFlowAnalysis< StateT >::setToExitState().
|
pure virtual |
Visit an operation with the lattices of its results.
This function is expected to set the lattices of the operation's operands.
Implemented in mlir::dataflow::LivenessAnalysis.