LLVM API Documentation
#include <ConstantRange.h>
Collaboration diagram for llvm::ConstantRange:
Public Member Functions | |
ConstantRange (const Type *Ty, bool isFullSet=true) | |
ConstantRange (Constant *Value) | |
ConstantRange (Constant *Lower, Constant *Upper) | |
ConstantRange (unsigned SetCCOpcode, ConstantIntegral *C) | |
ConstantIntegral * | getLower () const |
ConstantIntegral * | getUpper () const |
const Type * | getType () const |
bool | isFullSet () const |
bool | isEmptySet () const |
bool | isWrappedSet () const |
bool | contains (ConstantInt *Val) const |
ConstantIntegral * | getSingleElement () const |
bool | isSingleElement () const |
uint64_t | getSetSize () const |
bool | operator== (const ConstantRange &CR) const |
bool | operator!= (const ConstantRange &CR) const |
ConstantRange | subtract (ConstantInt *CI) const |
ConstantRange | intersectWith (const ConstantRange &CR) const |
ConstantRange | unionWith (const ConstantRange &CR) const |
ConstantRange | zeroExtend (const Type *Ty) const |
ConstantRange | truncate (const Type *Ty) const |
void | print (std::ostream &OS) const |
void | dump () const |
Definition at line 36 of file ConstantRange.h.
|
Initialize a full (the default) or empty set for the specified type. Definition at line 64 of file ConstantRange.cpp. References llvm::ConstantIntegral::getMaxValue(), llvm::ConstantIntegral::getMinValue(), and llvm::Type::isIntegral(). Referenced by intersectWith(), subtract(), truncate(), and zeroExtend(). |
|
Initialize a range to hold the single specified value. Definition at line 75 of file ConstantRange.cpp. |
|
Initialize a range of values explicitly... this will assert out if Lower==Upper and Lower != Min or Max for its type, if the two constants have different types, or if the constant are not integral values. Definition at line 83 of file ConstantRange.cpp. References llvm::ConstantIntegral::getMaxValue(), llvm::ConstantIntegral::getMinValue(), and llvm::Value::getType(). |
|
Initialize a set of values that all satisfy the condition with C. Definition at line 96 of file ConstantRange.cpp. References llvm::ConstantIntegral::getMinValue(), llvm::Value::getType(), Next(), llvm::ISD::SetEQ, llvm::ISD::SetGE, llvm::ISD::SetGT, llvm::ISD::SetLE, llvm::ISD::SetLT, and llvm::ISD::SetNE. |
|
contains - Return true if the specified value is in the set. Definition at line 169 of file ConstantRange.cpp. References isFullSet(), isWrappedSet(), LT(), and LTE(). Referenced by llvm::SCEVAddRecExpr::getNumIterationsInRange(). |
|
dump - Allow printing from a debugger easily... Definition at line 330 of file ConstantRange.cpp. References print(). |
|
getLower - Return the lower value for this range... Definition at line 59 of file ConstantRange.h. Referenced by intersect1Wrapped(), truncate(), and zeroExtend(). |
|
getSetSize - Return the number of elements in this set. Definition at line 154 of file ConstantRange.cpp. References llvm::Type::BoolTy, llvm::ConstantExpr::getSub(), getType(), and isEmptySet(). Referenced by intersect1Wrapped(), and truncate(). |
|
getSingleElement - If this set contains a single element, return it, otherwise return null. Definition at line 146 of file ConstantRange.cpp. References Next(). Referenced by isSingleElement(). |
|
getType - Return the LLVM data type of this range. Definition at line 122 of file ConstantRange.cpp. References llvm::Value::getType(). Referenced by getSetSize(), intersect1Wrapped(), intersectWith(), isEmptySet(), isFullSet(), subtract(), truncate(), unionWith(), and zeroExtend(). |
|
getUpper - Return the upper value for this range... Definition at line 63 of file ConstantRange.h. Referenced by llvm::SCEVAddRecExpr::getNumIterationsInRange(), intersect1Wrapped(), truncate(), and zeroExtend(). |
|
intersect - Return the range that results from the intersection of this range with another range. The resultant range is pruned as much as possible, but there may be cases where elements are included that are in one of the sets but not the other. For example: [100, 8) intersect [3, 120) yields [3, 120) Definition at line 236 of file ConstantRange.cpp. References ConstantRange(), getType(), intersect1Wrapped(), isEmptySet(), isFullSet(), isWrappedSet(), Lower, LT(), Max(), Min(), U, and Upper. |
|
isEmptySet - Return true if this set contains no members. Definition at line 132 of file ConstantRange.cpp. References llvm::ConstantIntegral::getMinValue(), and getType(). Referenced by getSetSize(), and intersectWith(). |
|
isFullSet - Return true if this set contains all of the elements possible for this data-type Definition at line 126 of file ConstantRange.cpp. References llvm::ConstantIntegral::getMaxValue(), and getType(). Referenced by contains(), llvm::SCEVAddRecExpr::getNumIterationsInRange(), intersectWith(), llvm::ScalarEvolution::print(), truncate(), and zeroExtend(). |
|
isSingleElement - Return true if this set contains exactly one member. Definition at line 94 of file ConstantRange.h. References getSingleElement(). |
|
isWrappedSet - Return true if this set wraps around the top of the range, for example: [100, 8) Definition at line 139 of file ConstantRange.cpp. References GT(). Referenced by contains(), intersect1Wrapped(), and intersectWith(). |
|
Definition at line 105 of file ConstantRange.h. References operator==(). |
|
operator== - Return true if this range is equal to another range. Definition at line 102 of file ConstantRange.h. Referenced by operator!=(). |
|
print - Print out the bounds to a stream... Definition at line 324 of file ConstantRange.cpp. Referenced by dump(), and llvm::operator<<(). |
|
subtract - Subtract the specified constant from the endpoints of this constant range. Definition at line 184 of file ConstantRange.cpp. References ConstantRange(), llvm::ConstantExpr::getSub(), getType(), llvm::Value::getType(), and llvm::Type::isInteger(). Referenced by llvm::SCEVAddRecExpr::getNumIterationsInRange(). |
|
truncate - Return a new range in the specified integer type, which must be strictly smaller than the current type. The returned range will correspond to the possible range of values if the source range had been truncated to the specified type. Definition at line 310 of file ConstantRange.cpp. References ConstantRange(), llvm::ConstantExpr::getCast(), getLower(), llvm::Type::getPrimitiveSize(), getSetSize(), getType(), getUpper(), and isFullSet(). |
|
union - Return the range that results from the union of this range with another range. The resultant range is guaranteed to include the elements of both sets, but may contain more. For example, [3, 9) union [12,15) is [3, 15), which includes 9, 10, and 11, which were not included in either set before. Definition at line 272 of file ConstantRange.cpp. References getType(). |
|
zeroExtend - Return a new range in the specified integer type, which must be strictly larger than the current type. The returned range will correspond to the possible range of values if the source range had been zero extended. Definition at line 284 of file ConstantRange.cpp. References ConstantRange(), llvm::ConstantUInt::get(), llvm::ConstantExpr::getCast(), getLower(), llvm::Constant::getNullValue(), llvm::Type::getPrimitiveSize(), llvm::Value::getType(), getType(), llvm::Type::getUnsignedVersion(), getUpper(), isFullSet(), llvm::Type::isInteger(), and llvm::Type::isUnsigned(). |