|
MLIR 22.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 LogicalResult | visitOperation (Operation *op, ArrayRef< StateT * > operands, ArrayRef< const StateT * > results)=0 |
| Visit an operation with the lattices of its results. | |
| virtual void | visitExternalCall (CallOpInterface call, ArrayRef< StateT * > argumentLattices, ArrayRef< const StateT * > resultLattices) |
| Visit a call to an external function. | |
| 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. | |
| LogicalResult | visit (ProgramPoint *point) override |
| Visit a program point. | |
| Public Member Functions inherited from mlir::DataFlowAnalysis | |
| virtual | ~DataFlowAnalysis () |
| DataFlowAnalysis (DataFlowSolver &solver) | |
| Create an analysis with a reference to the parent solver. | |
| virtual void | initializeEquivalentLatticeAnchor (Operation *top) |
| Initialize lattice anchor equivalence class from the provided top-level operation. | |
Protected Member Functions | |
| StateT * | getLatticeElement (Value value) override |
| Get the lattice element for a value. | |
| virtual void | setToExitState (StateT *lattice)=0 |
| Set the given lattice element(s) at control flow exit point(s). | |
| void | setToExitState (AbstractSparseLattice *lattice) override |
| Set the given lattice element(s) at control flow exit point(s) and propagate the update if it chaned. | |
| 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) and propagate the update if it chaned. | |
| SmallVector< AbstractSparseLattice * > | getLatticeElements (ValueRange values) |
| Get the lattice elements for a range of values. | |
| void | meet (AbstractSparseLattice *lhs, const AbstractSparseLattice &rhs) |
| Join the lattice element and propagate and update if it changed. | |
| virtual LogicalResult | visitCallableOperation (Operation *op, CallableOpInterface callable, ArrayRef< AbstractSparseLattice * > operandLattices) |
| Visits a callable operation. | |
| 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. | |
| void | propagateIfChanged (AnalysisState *state, ChangeResult changed) |
| Propagate an update to a state if it changed. | |
| template<typename AnchorT> | |
| void | registerAnchorKind () |
| Register a custom lattice anchor class. | |
| template<typename AnchorT, typename... Args> | |
| AnchorT * | getLatticeAnchor (Args &&...args) |
| Get or create a custom lattice anchor. | |
| template<typename StateT, typename AnchorT> | |
| void | unionLatticeAnchors (AnchorT anchor, AnchorT other) |
| Union input anchors under the given state. | |
| template<typename StateT, typename AnchorT> | |
| StateT * | getOrCreate (AnchorT anchor) |
| Get the analysis state associated with the lattice anchor. | |
| 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. | |
| ProgramPoint * | getProgramPointBefore (Operation *op) |
| Get a uniqued program point instance. | |
| 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. | |
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.
Visit a program point in sparse backward data-flow analysis will invoke the transfer function of the operation preceding the program point iterator. Visit a program point at the begining of block will visit the block itself.
Definition at line 516 of file SparseAnalysis.h.
|
inlineexplicit |
Definition at line 523 of file SparseAnalysis.h.
References mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::AbstractSparseBackwardDataFlowAnalysis(), and mlir::DataFlowAnalysis::DataFlowSolver.
|
inlineoverrideprotectedvirtual |
Get the lattice element for a value.
Implements mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis.
Definition at line 548 of file SparseAnalysis.h.
References mlir::DataFlowAnalysis::getOrCreate().
|
inlineprotected |
Definition at line 557 of file SparseAnalysis.h.
References mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::setAllToExitStates().
|
inlineoverrideprotectedvirtual |
Set the given lattice element(s) at control flow exit point(s) and propagate the update if it chaned.
Implements mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis.
Definition at line 554 of file SparseAnalysis.h.
References setToExitState().
|
protectedpure virtual |
Set the given lattice element(s) at control flow exit point(s).
Implemented in mlir::dataflow::LivenessAnalysis.
Referenced by 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 536 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.