MLIR  19.0.0git
Public Member Functions | List of all members
mlir::dataflow::IntegerRangeAnalysis Class Reference

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"

+ Inheritance diagram for mlir::dataflow::IntegerRangeAnalysis:

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)
 
- Public Member Functions inherited from mlir::dataflow::SparseForwardDataFlowAnalysis< IntegerValueRangeLattice >
 SparseForwardDataFlowAnalysis (DataFlowSolver &solver)
 
virtual void visitExternalCall (CallOpInterface call, ArrayRef< const IntegerValueRangeLattice * > argumentLattices, ArrayRef< IntegerValueRangeLattice * > resultLattices)
 Visit a call operation to an externally defined function given the lattices of its arguments. More...
 
- Public Member Functions inherited from mlir::dataflow::AbstractSparseForwardDataFlowAnalysis
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...
 
- Public Member Functions inherited from mlir::DataFlowAnalysis
virtual ~DataFlowAnalysis ()
 
 DataFlowAnalysis (DataFlowSolver &solver)
 Create an analysis with a reference to the parent solver. More...
 

Additional Inherited Members

- Protected Member Functions inherited from mlir::dataflow::SparseForwardDataFlowAnalysis< IntegerValueRangeLattice >
IntegerValueRangeLatticegetLatticeElement (Value value) override
 Get the lattice element for a value. More...
 
const IntegerValueRangeLatticegetLatticeElementFor (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)
 
- Protected Member Functions inherited from mlir::dataflow::AbstractSparseForwardDataFlowAnalysis
 AbstractSparseForwardDataFlowAnalysis (DataFlowSolver &solver)
 
const AbstractSparseLatticegetLatticeElementFor (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...
 
- Protected Member Functions inherited from mlir::DataFlowAnalysis
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...
 
const DataFlowConfiggetSolverConfig () const
 Return the configuration of the solver used for this analysis. More...
 

Detailed Description

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.

Member Function Documentation

◆ setToEntryState()

void mlir::dataflow::IntegerRangeAnalysis::setToEntryState ( IntegerValueRangeLattice lattice)
inlineoverridevirtual

◆ SparseForwardDataFlowAnalysis()

Definition at line 273 of file SparseAnalysis.h.

◆ visitNonControlFlowArguments()

void IntegerRangeAnalysis::visitNonControlFlowArguments ( Operation op,
const RegionSuccessor successor,
ArrayRef< IntegerValueRangeLattice * >  argLattices,
unsigned  firstIndex 
)
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.

◆ visitOperation()

void IntegerRangeAnalysis::visitOperation ( Operation op,
ArrayRef< const IntegerValueRangeLattice * >  operands,
ArrayRef< IntegerValueRangeLattice * >  results 
)
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.


The documentation for this class was generated from the following files: