18 #ifndef MLIR_ANALYSIS_DATAFLOW_INTEGERANGEANALYSIS_H
19 #define MLIR_ANALYSIS_DATAFLOW_INTEGERANGEANALYSIS_H
37 : value(std::move(value)) {}
51 return value == rhs.value;
65 void print(raw_ostream &os)
const { os << value; }
69 std::optional<ConstantIntRanges> value;
77 using Lattice::Lattice;
115 unsigned firstIndex)
override;
A set of arbitrary-precision integers representing bounds on a given integer value.
ConstantIntRanges rangeUnion(const ConstantIntRanges &other) const
Returns the union (computed separately for signed and unsigned bounds) of this range and other.
void propagateIfChanged(AnalysisState *state, ChangeResult changed)
Propagate an update to a state if it changed.
The general data-flow analysis solver.
Operation is the basic unit of execution within MLIR.
This class represents a successor of a region.
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Integer range analysis determines the integer value range of SSA values using operations that define ...
void visitOperation(Operation *op, ArrayRef< const IntegerValueRangeLattice * > operands, ArrayRef< IntegerValueRangeLattice * > results) override
Visit an operation.
void setToEntryState(IntegerValueRangeLattice *lattice) override
At an entry point, we cannot reason about interger value ranges.
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 ...
This lattice element represents the integer value range of an SSA value.
void onUpdate(DataFlowSolver *solver) const override
If the range can be narrowed to an integer constant, update the constant value of the SSA value.
This lattice value represents the integer range of an SSA value.
const ConstantIntRanges & getValue() const
Get the known integer value range.
void print(raw_ostream &os) const
Print the integer value range.
IntegerValueRange(std::optional< ConstantIntRanges > value=std::nullopt)
Create an integer value range lattice value.
bool isUninitialized() const
Whether the range is uninitialized.
bool operator==(const IntegerValueRange &rhs) const
Compare two ranges.
static IntegerValueRange getMaxRange(Value value)
Create a maximal range ([0, uint_max(t)] / [int_min(t), int_max(t)]) range that is used to mark the v...
static IntegerValueRange join(const IntegerValueRange &lhs, const IntegerValueRange &rhs)
Take the union of two ranges.
This class represents a lattice holding a specific value of type ValueT.
ChangeResult join(const AbstractSparseLattice &rhs) override
Join the information contained in the 'rhs' lattice into this lattice.
Value getPoint() const
Return the program point this lattice is located at.
A sparse forward data-flow analysis for propagating SSA value lattices across the IR by implementing ...
SparseForwardDataFlowAnalysis(DataFlowSolver &solver)
Include the generated interface declarations.