MLIR  20.0.0git
Public Member Functions | Protected Member Functions | List of all members
mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis Class Referenceabstract

Base class for sparse backward data-flow analyses. More...

#include "mlir/Analysis/DataFlow/SparseAnalysis.h"

+ Inheritance diagram for mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis:

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 AbstractSparseLatticegetLatticeElement (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...
 
ProgramPointgetProgramPointBefore (Operation *op)
 Get a uniqued program point instance. More...
 
ProgramPointgetProgramPointBefore (Block *block)
 
ProgramPointgetProgramPointAfter (Operation *op)
 
ProgramPointgetProgramPointAfter (Block *block)
 
const DataFlowConfiggetSolverConfig () const
 Return the configuration of the solver used for this analysis. More...
 

Detailed Description

Base class for sparse backward data-flow analyses.

Similar to AbstractSparseForwardDataFlowAnalysis, but walks bottom to top.

Definition at line 379 of file SparseAnalysis.h.

Constructor & Destructor Documentation

◆ AbstractSparseBackwardDataFlowAnalysis()

AbstractSparseBackwardDataFlowAnalysis::AbstractSparseBackwardDataFlowAnalysis ( DataFlowSolver solver,
SymbolTableCollection symbolTable 
)
explicitprotected

Definition at line 330 of file SparseAnalysis.cpp.

Member Function Documentation

◆ getLatticeElement()

virtual AbstractSparseLattice* mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::getLatticeElement ( Value  value)
protectedpure virtual

◆ getLatticeElements()

SmallVector< AbstractSparseLattice * > AbstractSparseBackwardDataFlowAnalysis::getLatticeElements ( ValueRange  values)
protected

Get the lattice elements for a range of values.

Definition at line 373 of file SparseAnalysis.cpp.

References getLatticeElement().

◆ initialize()

LogicalResult AbstractSparseBackwardDataFlowAnalysis::initialize ( Operation top)
overridevirtual

Initialize the analysis by visiting the operation and everything nested under it.

Implements mlir::DataFlowAnalysis.

Definition at line 337 of file SparseAnalysis.cpp.

◆ meet()

void AbstractSparseBackwardDataFlowAnalysis::meet ( AbstractSparseLattice lhs,
const AbstractSparseLattice rhs 
)
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().

◆ setAllToExitStates()

void AbstractSparseBackwardDataFlowAnalysis::setAllToExitStates ( ArrayRef< AbstractSparseLattice * >  lattices)
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().

◆ setToExitState()

virtual void mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::setToExitState ( AbstractSparseLattice lattice)
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().

◆ visit()

LogicalResult AbstractSparseBackwardDataFlowAnalysis::visit ( ProgramPoint point)
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().

◆ visitBranchOperand()

virtual void mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::visitBranchOperand ( OpOperand operand)
protectedpure virtual

◆ visitCallOperand()

virtual void mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::visitCallOperand ( OpOperand operand)
protectedpure virtual

◆ visitExternalCallImpl()

virtual void mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::visitExternalCallImpl ( CallOpInterface  call,
ArrayRef< AbstractSparseLattice * >  operandLattices,
ArrayRef< const AbstractSparseLattice * >  resultLattices 
)
protectedpure virtual

The transfer function for calls to external functions.

◆ visitOperationImpl()

virtual LogicalResult mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::visitOperationImpl ( Operation op,
ArrayRef< AbstractSparseLattice * >  operandLattices,
ArrayRef< const AbstractSparseLattice * >  resultLattices 
)
protectedpure virtual

The operation transfer function.

Given the result lattices, this function is expected to set the operand lattices.


The documentation for this class was generated from the following files: