LLVM 20.0.0git
|
This class represents a list of constant ranges. More...
#include "llvm/IR/ConstantRangeList.h"
Static Public Member Functions | |
static bool | isOrderedRanges (ArrayRef< ConstantRange > RangesRef) |
static std::optional< ConstantRangeList > | getConstantRangeList (ArrayRef< ConstantRange > RangesRef) |
This class represents a list of constant ranges.
Definition at line 30 of file ConstantRangeList.h.
|
default |
Referenced by getConstantRangeList().
|
inline |
Definition at line 35 of file ConstantRangeList.h.
References assert(), and getBitWidth().
|
inline |
Definition at line 49 of file ConstantRangeList.h.
|
inline |
Definition at line 51 of file ConstantRangeList.h.
LLVM_DUMP_METHOD void ConstantRangeList::dump | ( | ) | const |
Definition at line 242 of file ConstantRangeList.cpp.
References llvm::dbgs(), and print().
|
inline |
Return true if this list contains no members.
Definition at line 60 of file ConstantRangeList.h.
Referenced by inferInitializes(), insert(), intersectWith(), subtract(), and unionWith().
|
inline |
Definition at line 50 of file ConstantRangeList.h.
|
inline |
Definition at line 54 of file ConstantRangeList.h.
|
inline |
Get the bit width of this ConstantRangeList.
It is invalid to call this with an empty range.
Definition at line 64 of file ConstantRangeList.h.
Referenced by insert(), intersectWith(), subtract(), and unionWith().
|
static |
Definition at line 31 of file ConstantRangeList.cpp.
References ConstantRangeList(), and isOrderedRanges().
|
inline |
Definition at line 57 of file ConstantRangeList.h.
void ConstantRangeList::insert | ( | const ConstantRange & | NewRange | ) |
Insert a new range to Ranges and keep the list ordered.
Definition at line 37 of file ConstantRangeList.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), empty(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::ConstantRange::getBitWidth(), getBitWidth(), llvm::ConstantRange::getLower(), llvm::ConstantRange::getUpper(), llvm::ConstantRange::isEmptySet(), llvm::ConstantRange::isFullSet(), llvm::lower_bound(), llvm::APInt::sle(), llvm::APInt::slt(), and llvm::APIntOps::smax().
|
inline |
Definition at line 71 of file ConstantRangeList.h.
References llvm::Upper.
ConstantRangeList ConstantRangeList::intersectWith | ( | const ConstantRangeList & | CRL | ) | const |
Return the range list that results from the intersection of this ConstantRangeList with another ConstantRangeList, "CRL".
Definition at line 197 of file ConstantRangeList.cpp.
References assert(), empty(), End, getBitWidth(), llvm::ConstantRange::getLower(), llvm::ConstantRange::getUpper(), Range, size(), llvm::APInt::slt(), llvm::APIntOps::smax(), and llvm::APIntOps::smin().
Referenced by llvm::MDNode::getMostGenericNoaliasAddrspace(), and inferInitializes().
|
static |
Definition at line 14 of file ConstantRangeList.cpp.
References llvm::ArrayRef< T >::empty(), llvm::ConstantRange::getLower(), llvm::ConstantRange::getUpper(), Range, llvm::APInt::sge(), and llvm::ArrayRef< T >::size().
Referenced by getConstantRangeList().
|
inline |
Definition at line 90 of file ConstantRangeList.h.
References llvm::operator==().
|
inline |
Return true if this range list is equal to another range list.
Definition at line 87 of file ConstantRangeList.h.
void ConstantRangeList::print | ( | raw_ostream & | OS | ) | const |
Print out the ranges to a stream.
Definition at line 235 of file ConstantRangeList.cpp.
References llvm::ConstantRange::getLower(), llvm::ConstantRange::getUpper(), llvm::interleaveComma(), and OS.
Referenced by dump(), and llvm::Attribute::getAsString().
|
inline |
Definition at line 48 of file ConstantRangeList.h.
Referenced by llvm::AttrBuilder::addInitializesAttr(), and inferInitializes().
|
inline |
Return the number of ranges in this ConstantRangeList.
Definition at line 67 of file ConstantRangeList.h.
Referenced by intersectWith(), and unionWith().
void ConstantRangeList::subtract | ( | const ConstantRange & | SubRange | ) |
Definition at line 86 of file ConstantRangeList.cpp.
References assert(), empty(), End, llvm::ConstantRange::getBitWidth(), getBitWidth(), llvm::ConstantRange::getLower(), llvm::ConstantRange::getUpper(), llvm::ConstantRange::isEmptySet(), llvm::ConstantRange::isFullSet(), Range, llvm::APInt::sge(), llvm::APInt::sle(), and llvm::APInt::slt().
Referenced by inferInitializes().
ConstantRangeList ConstantRangeList::unionWith | ( | const ConstantRangeList & | CRL | ) | const |
Return the range list that results from the union of this ConstantRangeList with another ConstantRangeList, "CRL".
Definition at line 146 of file ConstantRangeList.cpp.
References assert(), empty(), getBitWidth(), llvm::ConstantRange::getLower(), llvm::ConstantRange::getUpper(), size(), llvm::APInt::slt(), and llvm::APIntOps::smax().
Referenced by inferInitializes().