MLIR
18.0.0git
|
Integer range analysis determines the integer value range of SSA values using operations that define InferIntRangeInterface
and also sets the range of iteration indices of loops with known bounds.
More...
#include "mlir/Analysis/DataFlow/IntegerRangeAnalysis.h"
Public Member Functions | |
void | setToEntryState (IntegerValueRangeLattice *lattice) override |
At an entry point, we cannot reason about interger value ranges. More... | |
void | visitOperation (Operation *op, ArrayRef< const IntegerValueRangeLattice * > operands, ArrayRef< IntegerValueRangeLattice * > results) override |
Visit an operation. More... | |
void | visitNonControlFlowArguments (Operation *op, const RegionSuccessor &successor, ArrayRef< IntegerValueRangeLattice * > argLattices, unsigned firstIndex) override |
Visit block arguments or operation results of an operation with region control-flow for which values are not defined by region control-flow. More... | |
SparseForwardDataFlowAnalysis (DataFlowSolver &solver) | |
![]() | |
SparseForwardDataFlowAnalysis (DataFlowSolver &solver) | |
![]() | |
LogicalResult | initialize (Operation *top) override |
Initialize the analysis by visiting every owner of an SSA value: all operations and blocks. More... | |
LogicalResult | visit (ProgramPoint point) override |
Visit a program point. More... | |
![]() | |
virtual | ~DataFlowAnalysis () |
DataFlowAnalysis (DataFlowSolver &solver) | |
Create an analysis with a reference to the parent solver. More... | |
Additional Inherited Members | |
![]() | |
IntegerValueRangeLattice * | getLatticeElement (Value value) override |
Get the lattice element for a value. More... | |
const IntegerValueRangeLattice * | getLatticeElementFor (ProgramPoint point, Value value) |
Get the lattice element for a value and create a dependency on the provided program point. More... | |
void | setAllToEntryStates (ArrayRef< IntegerValueRangeLattice * > lattices) |
![]() | |
AbstractSparseForwardDataFlowAnalysis (DataFlowSolver &solver) | |
const AbstractSparseLattice * | getLatticeElementFor (ProgramPoint point, Value value) |
Get a read-only lattice element for a value and add it as a dependency to a program point. More... | |
void | setAllToEntryStates (ArrayRef< AbstractSparseLattice * > lattices) |
void | join (AbstractSparseLattice *lhs, const AbstractSparseLattice &rhs) |
Join the lattice element and propagate and update if it changed. More... | |
![]() | |
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... | |
Integer range analysis determines the integer value range of SSA values using operations that define InferIntRangeInterface
and also sets the range of iteration indices of loops with known bounds.
This analysis depends on DeadCodeAnalysis, and will be a silent no-op if DeadCodeAnalysis is not loaded in the same solver context.
Definition at line 90 of file IntegerRangeAnalysis.h.
|
inlineoverridevirtual |
At an entry point, we cannot reason about interger value ranges.
Implements mlir::dataflow::SparseForwardDataFlowAnalysis< IntegerValueRangeLattice >.
Definition at line 96 of file IntegerRangeAnalysis.h.
References mlir::dataflow::IntegerValueRange::getMaxRange(), mlir::dataflow::Lattice< ValueT >::getPoint(), mlir::dataflow::Lattice< ValueT >::join(), and mlir::DataFlowAnalysis::propagateIfChanged().
|
inlineexplicit |
Definition at line 266 of file SparseAnalysis.h.
|
overridevirtual |
Visit block arguments or operation results of an operation with region control-flow for which values are not defined by region control-flow.
This function calls InferIntRangeInterface
to provide values for block arguments or tries to reduce the range on loop induction variables with known bounds.
Given the results of getConstant{Lower,Upper}Bound() or getConstantStep() on a LoopLikeInterface return the lower/upper bound for that result if possible.
Reimplemented from mlir::dataflow::SparseForwardDataFlowAnalysis< IntegerValueRangeLattice >.
Definition at line 122 of file IntegerRangeAnalysis.cpp.
|
overridevirtual |
Visit an operation.
Invoke the transfer function on each operation that implements InferIntRangeInterface
.
Implements mlir::dataflow::SparseForwardDataFlowAnalysis< IntegerValueRangeLattice >.
Definition at line 72 of file IntegerRangeAnalysis.cpp.