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

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

#include "mlir/Analysis/DataFlow/IntegerRangeAnalysis.h"

Public Member Functions

 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)
 Take the union of two ranges. More...
 

Detailed Description

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

Definition at line 28 of file IntegerRangeAnalysis.h.

Constructor & Destructor Documentation

◆ IntegerValueRange()

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

Create an integer value range lattice value.

Definition at line 36 of file IntegerRangeAnalysis.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 39 of file IntegerRangeAnalysis.cpp.

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

Referenced by mlir::dataflow::IntegerRangeAnalysis::setToEntryState().

◆ getValue()

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

Get the known integer value range.

Definition at line 44 of file IntegerRangeAnalysis.h.

References isUninitialized().

Referenced by join(), and mlir::dataflow::IntegerValueRangeLattice::onUpdate().

◆ isUninitialized()

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

Whether the range is uninitialized.

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

Definition at line 41 of file IntegerRangeAnalysis.h.

Referenced by getValue(), and join().

◆ join()

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

Take the union of two ranges.

Definition at line 55 of file IntegerRangeAnalysis.h.

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

◆ operator==()

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

Compare two ranges.

Definition at line 50 of file IntegerRangeAnalysis.h.

◆ print()

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

Print the integer value range.

Definition at line 65 of file IntegerRangeAnalysis.h.


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