MLIR  20.0.0git
Public Member Functions | List of all members
mlir::dataflow::AbstractSparseLattice Class Reference

This class represents an abstract lattice. More...

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

+ Inheritance diagram for mlir::dataflow::AbstractSparseLattice:

Public Member Functions

 AbstractSparseLattice (Value value)
 Lattices can only be created for values. More...
 
Value getAnchor () const
 Return the value this lattice is located at. More...
 
virtual ChangeResult join (const AbstractSparseLattice &rhs)
 Join the information contained in 'rhs' into this lattice. More...
 
virtual ChangeResult meet (const AbstractSparseLattice &rhs)
 Meet (intersect) the information in this lattice with 'rhs'. More...
 
void onUpdate (DataFlowSolver *solver) const override
 When the lattice gets updated, propagate an update to users of the value using its use-def chain to subscribed analyses. More...
 
void useDefSubscribe (DataFlowAnalysis *analysis)
 Subscribe an analysis to updates of the lattice. More...
 
- Public Member Functions inherited from mlir::AnalysisState
virtual ~AnalysisState ()
 
 AnalysisState (LatticeAnchor anchor)
 Create the analysis state on the given lattice anchor. More...
 
LatticeAnchor getAnchor () const
 Returns the lattice anchor this state is located at. More...
 
virtual void print (raw_ostream &os) const =0
 Print the contents of the analysis state. More...
 
LLVM_DUMP_METHOD void dump () const
 
void addDependency (ProgramPoint *point, DataFlowAnalysis *analysis)
 Add a dependency to this analysis state on a lattice anchor and an analysis. More...
 

Additional Inherited Members

- Protected Attributes inherited from mlir::AnalysisState
LatticeAnchor anchor
 The lattice anchor to which the state belongs. More...
 

Detailed Description

This class represents an abstract lattice.

A lattice contains information about an SSA value and is what's propagated across the IR by sparse data-flow analysis.

Definition at line 34 of file SparseAnalysis.h.

Constructor & Destructor Documentation

◆ AbstractSparseLattice()

mlir::dataflow::AbstractSparseLattice::AbstractSparseLattice ( Value  value)
inline

Lattices can only be created for values.

Definition at line 37 of file SparseAnalysis.h.

Member Function Documentation

◆ getAnchor()

Value mlir::dataflow::AbstractSparseLattice::getAnchor ( ) const
inline

Return the value this lattice is located at.

Definition at line 40 of file SparseAnalysis.h.

References mlir::AnalysisState::getAnchor().

◆ join()

virtual ChangeResult mlir::dataflow::AbstractSparseLattice::join ( const AbstractSparseLattice rhs)
inlinevirtual

Join the information contained in 'rhs' into this lattice.

Returns if the value of the lattice changed.

Reimplemented in mlir::dataflow::Lattice< ValueT >, and mlir::dataflow::Lattice< IntegerValueRange >.

Definition at line 44 of file SparseAnalysis.h.

References mlir::NoChange.

Referenced by mlir::dataflow::AbstractSparseForwardDataFlowAnalysis::join().

◆ meet()

virtual ChangeResult mlir::dataflow::AbstractSparseLattice::meet ( const AbstractSparseLattice rhs)
inlinevirtual

Meet (intersect) the information in this lattice with 'rhs'.

Returns if the value of the lattice changed.

Reimplemented in mlir::dataflow::Lattice< ValueT >, mlir::dataflow::Lattice< IntegerValueRange >, and mlir::dataflow::Liveness.

Definition at line 50 of file SparseAnalysis.h.

References mlir::NoChange.

Referenced by mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::meet().

◆ onUpdate()

void AbstractSparseLattice::onUpdate ( DataFlowSolver solver) const
overridevirtual

When the lattice gets updated, propagate an update to users of the value using its use-def chain to subscribed analyses.

Reimplemented from mlir::AnalysisState.

Definition at line 33 of file SparseAnalysis.cpp.

References mlir::AnalysisState::anchor, mlir::DataFlowSolver::enqueue(), mlir::DataFlowSolver::getProgramPointAfter(), mlir::Value::getUsers(), and mlir::AnalysisState::onUpdate().

Referenced by mlir::dataflow::IntegerValueRangeLattice::onUpdate().

◆ useDefSubscribe()

void mlir::dataflow::AbstractSparseLattice::useDefSubscribe ( DataFlowAnalysis analysis)
inline

Subscribe an analysis to updates of the lattice.

When the lattice changes, subscribed analyses are re-invoked on all users of the value. This is more efficient than relying on the dependency map.

Definition at line 61 of file SparseAnalysis.h.


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