MLIR  17.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:
+ Collaboration 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...
 
 SparseDataFlowAnalysis (DataFlowSolver &solver)
 
- Public Member Functions inherited from mlir::dataflow::SparseDataFlowAnalysis< IntegerValueRangeLattice >
 SparseDataFlowAnalysis (DataFlowSolver &solver)
 
- Public Member Functions inherited from mlir::dataflow::AbstractSparseDataFlowAnalysis
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::SparseDataFlowAnalysis< 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::AbstractSparseDataFlowAnalysis
 AbstractSparseDataFlowAnalysis (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 assiocated 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...
 

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.

Definition at line 84 of file IntegerRangeAnalysis.h.

Member Function Documentation

◆ setToEntryState()

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

◆ SparseDataFlowAnalysis()

Definition at line 265 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::SparseDataFlowAnalysis< IntegerValueRangeLattice >.

Definition at line 126 of file IntegerRangeAnalysis.cpp.

References mlir::Value::dyn_cast(), mlir::Attribute::dyn_cast_or_null(), mlir::ConstantIntRanges::fromSigned(), mlir::Region::getArguments(), mlir::dataflow::SparseDataFlowAnalysis< IntegerValueRangeLattice >::getLatticeElement(), mlir::dataflow::SparseDataFlowAnalysis< IntegerValueRangeLattice >::getLatticeElementFor(), mlir::dataflow::IntegerValueRange::getMaxRange(), mlir::Operation::getOperands(), mlir::ConstantIntRanges::getStorageBitwidth(), mlir::RegionSuccessor::getSuccessor(), mlir::Value::getUsers(), mlir::dataflow::Lattice< ValueT >::getValue(), mlir::dataflow::IntegerValueRange::getValue(), mlir::dataflow::IntegerValueRange::isUninitialized(), mlir::dataflow::Lattice< ValueT >::join(), max(), min(), mlir::DataFlowAnalysis::propagateIfChanged(), mlir::ConstantIntRanges::smax(), mlir::ConstantIntRanges::smin(), and mlir::dataflow::SparseDataFlowAnalysis< StateT >::visitNonControlFlowArguments().

◆ visitOperation()

void IntegerRangeAnalysis::visitOperation ( Operation op,
ArrayRef< const IntegerValueRangeLattice * >  operands,
ArrayRef< IntegerValueRangeLattice * >  results 
)
overridevirtual

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