MLIR
20.0.0git
|
This class represents a lattice holding a specific value of type ValueT
.
More...
#include "mlir/Analysis/DataFlow/SparseAnalysis.h"
Public Types | |
using | LatticeT = Lattice< ValueT > |
template<typename T , typename... Args> | |
using | has_meet = decltype(&T::meet) |
Trait to check if T provides a meet method. More... | |
template<typename T > | |
using | lattice_has_meet = llvm::is_detected< has_meet, T > |
Public Member Functions | |
Value | getAnchor () const |
Return the value this lattice is located at. More... | |
ValueT & | getValue () |
Return the value held by this lattice. More... | |
const ValueT & | getValue () const |
ChangeResult | join (const AbstractSparseLattice &rhs) override |
Join the information contained in the 'rhs' lattice into this lattice. More... | |
ChangeResult | meet (const AbstractSparseLattice &rhs) override |
Meet (intersect) the information contained in the 'rhs' lattice with this lattice. More... | |
ChangeResult | join (const ValueT &rhs) |
Join the information contained in the 'rhs' value into this lattice. More... | |
template<typename VT , std::enable_if_t< lattice_has_meet< VT >::value > * = nullptr> | |
ChangeResult | meet (const VT &rhs) |
Meet (intersect) the information contained in the 'rhs' value with this lattice. More... | |
template<typename VT , std::enable_if_t<!lattice_has_meet< VT >::value > * = nullptr> | |
ChangeResult | meet (const VT &rhs) |
void | print (raw_ostream &os) const override |
Print the lattice element. More... | |
AbstractSparseLattice (Value value) | |
Lattices can only be created for values. More... | |
Public Member Functions inherited from mlir::dataflow::AbstractSparseLattice | |
AbstractSparseLattice (Value value) | |
Lattices can only be created for values. More... | |
Value | getAnchor () const |
Return the value this lattice is located at. 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... | |
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... | |
This class represents a lattice holding a specific value of type ValueT
.
Lattice values (ValueT
) are required to adhere to the following:
lhs
and rhs
into a new value. This method is required to be monotonic.Definition at line 85 of file SparseAnalysis.h.
using mlir::dataflow::Lattice< ValueT >::has_meet = decltype(&T::meet) |
Trait to check if T
provides a meet
method.
Needed since for forward analysis, lattices will only have a join
, no meet
, but we want to use the same Lattice
class for both directions.
Definition at line 135 of file SparseAnalysis.h.
using mlir::dataflow::Lattice< ValueT >::lattice_has_meet = llvm::is_detected<has_meet, T> |
Definition at line 137 of file SparseAnalysis.h.
using mlir::dataflow::Lattice< ValueT >::LatticeT = Lattice<ValueT> |
Definition at line 99 of file SparseAnalysis.h.
|
inline |
Lattices can only be created for values.
Definition at line 37 of file SparseAnalysis.h.
|
inline |
Return the value this lattice is located at.
Definition at line 90 of file SparseAnalysis.h.
References mlir::AnalysisState::anchor.
Referenced by mlir::dataflow::IntegerRangeAnalysis::setToEntryState().
|
inline |
Return the value held by this lattice.
This requires that the value is initialized.
Definition at line 94 of file SparseAnalysis.h.
Referenced by getOperandValuesImpl(), mlir::dataflow::Lattice< ValueT >::getValue(), mlir::dataflow::Lattice< ValueT >::join(), mlir::dataflow::Lattice< ValueT >::meet(), mlir::dataflow::IntegerRangeAnalysis::visitNonControlFlowArguments(), and mlir::dataflow::IntegerRangeAnalysis::visitOperation().
|
inline |
Definition at line 95 of file SparseAnalysis.h.
References mlir::dataflow::Lattice< ValueT >::getValue().
|
inlineoverridevirtual |
Join the information contained in the 'rhs' lattice into this lattice.
Returns if the state of the current lattice changed.
Reimplemented from mlir::dataflow::AbstractSparseLattice.
Definition at line 103 of file SparseAnalysis.h.
References mlir::dataflow::Lattice< ValueT >::getValue().
Referenced by copyIntegerRange(), mlir::dataflow::IntegerRangeAnalysis::setToEntryState(), mlir::dataflow::SparseConstantPropagation::setToEntryState(), mlir::dataflow::IntegerRangeAnalysis::visitNonControlFlowArguments(), mlir::dataflow::IntegerRangeAnalysis::visitOperation(), and mlir::dataflow::SparseConstantPropagation::visitOperation().
|
inline |
Join the information contained in the 'rhs' value into this lattice.
Returns if the state of the current lattice changed.
Definition at line 115 of file SparseAnalysis.h.
References mlir::Change, and mlir::NoChange.
|
inlineoverridevirtual |
Meet (intersect) the information contained in the 'rhs' lattice with this lattice.
Returns if the state of the current lattice changed.
Reimplemented from mlir::dataflow::AbstractSparseLattice.
Definition at line 109 of file SparseAnalysis.h.
References mlir::dataflow::Lattice< ValueT >::getValue().
|
inline |
Meet (intersect) the information contained in the 'rhs' value with this lattice.
Returns if the state of the current lattice changed. If the lattice elements don't have a meet
method, this is a no-op (see below.)
Definition at line 144 of file SparseAnalysis.h.
References mlir::Change, and mlir::NoChange.
|
inline |
Definition at line 161 of file SparseAnalysis.h.
References mlir::NoChange.
|
inlineoverridevirtual |
Print the lattice element.
Implements mlir::AnalysisState.
Definition at line 166 of file SparseAnalysis.h.