MLIR  19.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 void 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 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 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 373 of file SparseAnalysis.h.

Constructor & Destructor Documentation

◆ AbstractSparseBackwardDataFlowAnalysis()

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

Definition at line 317 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 361 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 324 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 598 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 592 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 this is a 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 346 of file SparseAnalysis.cpp.

◆ 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 void 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: