18#ifndef MLIR_ANALYSIS_DATAFLOW_INTEGERANGEANALYSIS_H
19#define MLIR_ANALYSIS_DATAFLOW_INTEGERANGEANALYSIS_H
33 using Lattice::Lattice;
73 unsigned firstIndex)
override;
friend class DataFlowSolver
Allow the framework to access the dependents.
void propagateIfChanged(AnalysisState *state, ChangeResult changed)
Propagate an update to a state if it changed.
The general data-flow analysis solver.
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...
Operation is the basic unit of execution within MLIR.
This class represents a successor of a region.
This class coordinates the application of a rewrite on a set of IR, providing a way for clients to tr...
This class provides an abstraction over the different types of ranges over Values.
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 setToEntryState(IntegerValueRangeLattice *lattice) override
At an entry point, we cannot reason about integer value ranges.
void visitNonControlFlowArguments(Operation *op, const RegionSuccessor &successor, ValueRange successorInputs, ArrayRef< IntegerValueRangeLattice * > argLattices, unsigned firstIndex) override
Visit block arguments or operation results of an operation with region control-flow for which values ...
LogicalResult visitOperation(Operation *op, ArrayRef< const IntegerValueRangeLattice * > operands, ArrayRef< IntegerValueRangeLattice * > results) override
Visit an operation.
SparseForwardDataFlowAnalysis(DataFlowSolver &solver)
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 class represents a lattice holding a specific value of type ValueT.
Value getAnchor() const
Return the value this lattice is located at.
ChangeResult join(const AbstractSparseLattice &rhs) override
Join the information contained in the 'rhs' lattice into this lattice.
SparseForwardDataFlowAnalysis(DataFlowSolver &solver)
LogicalResult staticallyNonNegative(DataFlowSolver &solver, Operation *op)
Succeeds if an op can be converted to its unsigned equivalent without changing its semantics.
LogicalResult maybeReplaceWithConstant(DataFlowSolver &solver, RewriterBase &rewriter, Value value)
Patterned after SCCP.
Include the generated interface declarations.