|
MLIR 23.0.0git
|
This lattice element represents the integer value range of an SSA value. More...
#include "mlir/Analysis/DataFlow/IntegerRangeAnalysis.h"
Public Member Functions | |
| ChangeResult | join (const AbstractSparseLattice &rhs) override |
| Join the information contained in 'rhs' into this lattice. | |
| ChangeResult | join (const ValueT &rhs) |
| Join the information contained in the 'rhs' value into this lattice. | |
| Public Member Functions inherited from mlir::dataflow::Lattice< IntegerValueRange > | |
| AbstractSparseLattice (Value value) | |
| Lattices can only be created for values. | |
| Value | getAnchor () const |
| Return the value this lattice is located at. | |
| IntegerValueRange & | getValue () |
| Return the value held by this lattice. | |
| ChangeResult | join (const AbstractSparseLattice &rhs) override |
| Join the information contained in the 'rhs' lattice into this lattice. | |
| ChangeResult | meet (const AbstractSparseLattice &rhs) override |
| Meet (intersect) the information contained in the 'rhs' lattice with this lattice. | |
| void | print (raw_ostream &os) const override |
| Print the lattice element. | |
| Public Member Functions inherited from mlir::dataflow::AbstractSparseLattice | |
| AbstractSparseLattice (Value value) | |
| Lattices can only be created for values. | |
| Value | getAnchor () const |
| Return the value this lattice is located at. | |
| 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. | |
| void | useDefSubscribe (DataFlowAnalysis *analysis) |
| Subscribe an analysis to updates of the lattice. | |
| Public Member Functions inherited from mlir::AnalysisState | |
| virtual | ~AnalysisState () |
| AnalysisState (LatticeAnchor anchor) | |
| Create the analysis state on the given lattice anchor. | |
| LatticeAnchor | getAnchor () const |
| Returns the lattice anchor this state is located at. | |
| 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. | |
Additional Inherited Members | |
| Public Types inherited from mlir::dataflow::Lattice< IntegerValueRange > | |
| using | LatticeT |
| using | has_meet |
| Trait to check if T provides a meet method. | |
| using | lattice_has_meet |
| Protected Attributes inherited from mlir::AnalysisState | |
| LatticeAnchor | anchor |
| The lattice anchor to which the state belongs. | |
This lattice element represents the integer value range of an SSA value.
join overrides the base behaviour to apply per-state widening: once the lattice has absorbed enough strictly-increasing merges the range is forced to its max as a sound over-approximation. This is the sole convergence guarantee for IntegerRangeAnalysis on loop-carried values; without it, scf.while loops with dynamic bounds and nested region ops can keep the solver ratcheting a loop-carried range by +1 per worklist visit for up to 2^31 iterations on i32. The budget is sized to be much larger than realistic merge counts on naturally bounded accumulators (e.g. arith.minsi/arith.andi-clamped iter args) so the analysis still converges to a tight range on those.
Note that only the (const AbstractSparseLattice &) overload is overridden, so the widening fires only at framework merge sites (block-arg / region-successor / callable-arg joins) — transfer-function updates that go through the non-virtual join(const ValueT &) overload are unaffected.
Definition at line 46 of file IntegerRangeAnalysis.h.
|
overridevirtual |
Join the information contained in 'rhs' into this lattice.
Returns if the value of the lattice changed.
Reimplemented from mlir::dataflow::AbstractSparseLattice.
Definition at line 73 of file IntegerRangeAnalysis.cpp.
References mlir::dataflow::Lattice< IntegerValueRange >::AbstractSparseLattice(), mlir::Change, mlir::dataflow::Lattice< IntegerValueRange >::getAnchor(), mlir::IntegerValueRange::getMaxRange(), mlir::dataflow::Lattice< ValueT >::join(), kIntegerRangeWideningBudget, and rhs.
Referenced by copyIntegerRange(), mlir::dataflow::IntegerRangeAnalysis::setToEntryState(), mlir::dataflow::IntegerRangeAnalysis::visitNonControlFlowArguments(), and mlir::dataflow::IntegerRangeAnalysis::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.