MLIR 22.0.0git
mlir::IntegerValueRange Class Reference

This lattice value represents the integer range of an SSA value. More...

#include "mlir/Interfaces/InferIntRangeInterface.h"

Public Member Functions

 IntegerValueRange (ConstantIntRanges value)
 Create an integer value range lattice value.
 IntegerValueRange (std::optional< ConstantIntRanges > value=std::nullopt)
 Create an integer value range lattice value.
bool isUninitialized () const
 Whether the range is uninitialized.
const ConstantIntRangesgetValue () const
 Get the known integer value range.
bool operator== (const IntegerValueRange &rhs) const
 Compare two ranges.
void print (raw_ostream &os) const
 Print the integer value range.

Static Public Member Functions

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 value as unable to be analyzed further, where t is the type of value.
static IntegerValueRange join (const IntegerValueRange &lhs, const IntegerValueRange &rhs)
 Compute the least upper bound of two ranges.

Detailed Description

This lattice value represents the integer range of an SSA value.

Definition at line 109 of file InferIntRangeInterface.h.

Constructor & Destructor Documentation

◆ IntegerValueRange() [1/2]

mlir::IntegerValueRange::IntegerValueRange ( ConstantIntRanges value)
inline

Create an integer value range lattice value.

Definition at line 117 of file InferIntRangeInterface.h.

Referenced by getMaxRange(), join(), and operator==().

◆ IntegerValueRange() [2/2]

mlir::IntegerValueRange::IntegerValueRange ( std::optional< ConstantIntRanges > value = std::nullopt)
inlineexplicit

Create an integer value range lattice value.

Definition at line 120 of file InferIntRangeInterface.h.

Member Function Documentation

◆ getMaxRange()

IntegerValueRange IntegerValueRange::getMaxRange ( Value value)
static

Create a maximal range ([0, uint_max(t)] / [int_min(t), int_max(t)]) range that is used to mark the value as unable to be analyzed further, where t is the type of value.

Definition at line 135 of file InferIntRangeInterface.cpp.

References mlir::ConstantIntRanges::getStorageBitwidth(), and IntegerValueRange().

Referenced by mlir::detail::infer_int_range_op_binder::match(), mlir::dataflow::IntegerRangeAnalysis::setToEntryState(), mlir::dataflow::IntegerRangeAnalysis::visitNonControlFlowArguments(), and mlir::dataflow::IntegerRangeAnalysis::visitOperation().

◆ getValue()

◆ isUninitialized()

bool mlir::IntegerValueRange::isUninitialized ( ) const
inline

Whether the range is uninitialized.

This happens when the state hasn't been set during the analysis.

Definition at line 126 of file InferIntRangeInterface.h.

Referenced by getValue(), mlir::intrange::inferShapedDimOpInterface(), mlir::dataflow::IntegerRangeAnalysis::visitNonControlFlowArguments(), and mlir::dataflow::IntegerRangeAnalysis::visitOperation().

◆ join()

IntegerValueRange mlir::IntegerValueRange::join ( const IntegerValueRange & lhs,
const IntegerValueRange & rhs )
inlinestatic

Compute the least upper bound of two ranges.

Definition at line 140 of file InferIntRangeInterface.h.

References IntegerValueRange(), lhs, and rhs.

◆ operator==()

bool mlir::IntegerValueRange::operator== ( const IntegerValueRange & rhs) const
inline

Compare two ranges.

Definition at line 135 of file InferIntRangeInterface.h.

References IntegerValueRange(), and rhs.

◆ print()

void mlir::IntegerValueRange::print ( raw_ostream & os) const
inline

Print the integer value range.

Definition at line 150 of file InferIntRangeInterface.h.

Referenced by mlir::operator<<().


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