MLIR
20.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... | |
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 | |
AbstractSparseBackwardDataFlowAnalysis (DataFlowSolver &solver, SymbolTableCollection &symbolTable) | |
virtual LogicalResult | visitOperationImpl (Operation *op, ArrayRef< AbstractSparseLattice * > operandLattices, ArrayRef< const AbstractSparseLattice * > resultLattices)=0 |
The operation transfer function. More... | |
virtual void | visitExternalCallImpl (CallOpInterface call, ArrayRef< AbstractSparseLattice * > operandLattices, ArrayRef< const AbstractSparseLattice * > resultLattices)=0 |
The transfer function for calls to external functions. 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... | |
Protected Member Functions inherited from mlir::DataFlowAnalysis | |
void | addDependency (AnalysisState *state, ProgramPoint *point) |
Create a dependency between the given analysis state and lattice anchor on this analysis. More... | |
void | propagateIfChanged (AnalysisState *state, ChangeResult changed) |
Propagate an update to a state if it changed. More... | |
template<typename AnchorT > | |
void | registerAnchorKind () |
Register a custom lattice anchor class. More... | |
template<typename AnchorT , typename... Args> | |
AnchorT * | getLatticeAnchor (Args &&...args) |
Get or create a custom lattice anchor. More... | |
template<typename StateT , typename AnchorT > | |
StateT * | getOrCreate (AnchorT anchor) |
Get the analysis state associated with the lattice anchor. More... | |
template<typename StateT , typename AnchorT > | |
const StateT * | getOrCreateFor (ProgramPoint *dependent, AnchorT anchor) |
Get a read-only analysis state for the given point and create a dependency on dependent . More... | |
ProgramPoint * | getProgramPointBefore (Operation *op) |
Get a uniqued program point instance. More... | |
ProgramPoint * | getProgramPointBefore (Block *block) |
ProgramPoint * | getProgramPointAfter (Operation *op) |
ProgramPoint * | getProgramPointAfter (Block *block) |
const DataFlowConfig & | getSolverConfig () const |
Return the configuration of the solver used for this analysis. More... | |
Base class for sparse backward data-flow analyses.
Similar to AbstractSparseForwardDataFlowAnalysis, but walks bottom to top.
Definition at line 379 of file SparseAnalysis.h.
|
explicitprotected |
Definition at line 330 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 373 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 337 of file SparseAnalysis.cpp.
|
protected |
Join the lattice element and propagate and update if it changed.
Definition at line 617 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 611 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 it is after 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 362 of file SparseAnalysis.cpp.
References mlir::ProgramPoint::getPrevOp(), and mlir::ProgramPoint::isBlockStart().
|
protectedpure virtual |
Implemented in mlir::dataflow::LivenessAnalysis.
|
protectedpure virtual |
Implemented in mlir::dataflow::LivenessAnalysis.
Referenced by mlir::dataflow::SparseBackwardDataFlowAnalysis< StateT >::visitExternalCall().
|
protectedpure virtual |
The transfer function for calls to external functions.
|
protectedpure virtual |
The operation transfer function.
Given the result lattices, this function is expected to set the operand lattices.