MLIR  20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
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. More...
 
 IntegerValueRange (std::optional< ConstantIntRanges > value=std::nullopt)
 Create an integer value range lattice value. More...
 
bool isUninitialized () const
 Whether the range is uninitialized. More...
 
const ConstantIntRangesgetValue () const
 Get the known integer value range. More...
 
bool operator== (const IntegerValueRange &rhs) const
 Compare two ranges. More...
 
void print (raw_ostream &os) const
 Print the integer value range. More...
 

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. More...
 
static IntegerValueRange join (const IntegerValueRange &lhs, const IntegerValueRange &rhs)
 Compute the least upper bound of two ranges. More...
 

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.

◆ IntegerValueRange() [2/2]

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

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 132 of file InferIntRangeInterface.cpp.

References mlir::ConstantIntRanges::getStorageBitwidth(), and mlir::Value::getType().

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

◆ getValue()

const ConstantIntRanges& mlir::IntegerValueRange::getValue ( ) const
inline

◆ 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 125 of file InferIntRangeInterface.h.

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

◆ join()

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

Compute the least upper bound of two ranges.

Definition at line 139 of file InferIntRangeInterface.h.

References getValue(), isUninitialized(), and mlir::ConstantIntRanges::rangeUnion().

◆ operator==()

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

Compare two ranges.

Definition at line 134 of file InferIntRangeInterface.h.

◆ print()

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

Print the integer value range.

Definition at line 149 of file InferIntRangeInterface.h.

Referenced by mlir::operator<<().


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