MLIR
19.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... | |
virtual void | visitExternalCall (CallOpInterface call, ArrayRef< StateT * > argumentLattices, ArrayRef< const StateT * > resultLattices) |
Visit a call to an external function. More... | |
Public Member Functions inherited from mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis | |
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... | |
Public Member Functions inherited from mlir::DataFlowAnalysis | |
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) |
Protected Member Functions inherited from mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis | |
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... | |
Protected Member Functions inherited from mlir::DataFlowAnalysis | |
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... | |
const DataFlowConfig & | getSolverConfig () const |
Return the configuration of the solver used for this analysis. 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 466 of file SparseAnalysis.h.
|
inlineexplicit |
Definition at line 469 of file SparseAnalysis.h.
|
inlineoverrideprotectedvirtual |
Get the lattice element for a value.
Implements mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis.
Definition at line 493 of file SparseAnalysis.h.
|
inlineprotected |
Definition at line 502 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 499 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().
|
inlinevirtual |
Visit a call to an external function.
This function is expected to set lattice values of the call operands. By default, calls visitCallOperand
for all operands.
Definition at line 481 of file SparseAnalysis.h.
References mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::visitCallOperand().
|
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.