|
LLVM
3.7.0
|
This class represents a range of values. More...
#include <ConstantRange.h>
Public Member Functions | |
| ConstantRange (uint32_t BitWidth, bool isFullSet=true) | |
| Initialize a full (the default) or empty set for the specified bit width. More... | |
| ConstantRange (APIntMoveTy Value) | |
| Initialize a range to hold the single specified value. More... | |
| ConstantRange (APIntMoveTy Lower, APIntMoveTy Upper) | |
| Initialize a range of values explicitly. More... | |
| const APInt & | getLower () const |
| Return the lower value for this range. More... | |
| const APInt & | getUpper () const |
| Return the upper value for this range. More... | |
| uint32_t | getBitWidth () const |
| Get the bit width of this ConstantRange. More... | |
| bool | isFullSet () const |
| Return true if this set contains all of the elements possible for this data-type. More... | |
| bool | isEmptySet () const |
| Return true if this set contains no members. More... | |
| bool | isWrappedSet () const |
| Return true if this set wraps around the top of the range. More... | |
| bool | isSignWrappedSet () const |
| Return true if this set wraps around the INT_MIN of its bitwidth. More... | |
| bool | contains (const APInt &Val) const |
| Return true if the specified value is in the set. More... | |
| bool | contains (const ConstantRange &CR) const |
| Return true if the other range is a subset of this one. More... | |
| const APInt * | getSingleElement () const |
| If this set contains a single element, return it, otherwise return null. More... | |
| bool | isSingleElement () const |
| Return true if this set contains exactly one member. More... | |
| APInt | getSetSize () const |
| Return the number of elements in this set. More... | |
| APInt | getUnsignedMax () const |
| Return the largest unsigned value contained in the ConstantRange. More... | |
| APInt | getUnsignedMin () const |
| Return the smallest unsigned value contained in the ConstantRange. More... | |
| APInt | getSignedMax () const |
| Return the largest signed value contained in the ConstantRange. More... | |
| APInt | getSignedMin () const |
| Return the smallest signed value contained in the ConstantRange. More... | |
| bool | operator== (const ConstantRange &CR) const |
| Return true if this range is equal to another range. More... | |
| bool | operator!= (const ConstantRange &CR) const |
| ConstantRange | subtract (const APInt &CI) const |
| Subtract the specified constant from the endpoints of this constant range. More... | |
| ConstantRange | difference (const ConstantRange &CR) const |
| Subtract the specified range from this range (aka relative complement of the sets). More... | |
| ConstantRange | intersectWith (const ConstantRange &CR) const |
| Return the range that results from the intersection of this range with another range. More... | |
| ConstantRange | unionWith (const ConstantRange &CR) const |
| Return the range that results from the union of this range with another range. More... | |
| ConstantRange | zeroExtend (uint32_t BitWidth) const |
| Return a new range in the specified integer type, which must be strictly larger than the current type. More... | |
| ConstantRange | signExtend (uint32_t BitWidth) const |
| Return a new range in the specified integer type, which must be strictly larger than the current type. More... | |
| ConstantRange | truncate (uint32_t BitWidth) const |
| Return a new range in the specified integer type, which must be strictly smaller than the current type. More... | |
| ConstantRange | zextOrTrunc (uint32_t BitWidth) const |
Make this range have the bit width given by BitWidth. More... | |
| ConstantRange | sextOrTrunc (uint32_t BitWidth) const |
Make this range have the bit width given by BitWidth. More... | |
| ConstantRange | add (const ConstantRange &Other) const |
Return a new range representing the possible values resulting from an addition of a value in this range and a value in Other. More... | |
| ConstantRange | sub (const ConstantRange &Other) const |
Return a new range representing the possible values resulting from a subtraction of a value in this range and a value in Other. More... | |
| ConstantRange | multiply (const ConstantRange &Other) const |
Return a new range representing the possible values resulting from a multiplication of a value in this range and a value in Other, treating both this and Other as unsigned ranges. More... | |
| ConstantRange | smax (const ConstantRange &Other) const |
Return a new range representing the possible values resulting from a signed maximum of a value in this range and a value in Other. More... | |
| ConstantRange | umax (const ConstantRange &Other) const |
Return a new range representing the possible values resulting from an unsigned maximum of a value in this range and a value in Other. More... | |
| ConstantRange | udiv (const ConstantRange &Other) const |
Return a new range representing the possible values resulting from an unsigned division of a value in this range and a value in Other. More... | |
| ConstantRange | binaryAnd (const ConstantRange &Other) const |
Return a new range representing the possible values resulting from a binary-and of a value in this range by a value in Other. More... | |
| ConstantRange | binaryOr (const ConstantRange &Other) const |
Return a new range representing the possible values resulting from a binary-or of a value in this range by a value in Other. More... | |
| ConstantRange | shl (const ConstantRange &Other) const |
Return a new range representing the possible values resulting from a left shift of a value in this range by a value in Other. More... | |
| ConstantRange | lshr (const ConstantRange &Other) const |
Return a new range representing the possible values resulting from a logical right shift of a value in this range and a value in Other. More... | |
| ConstantRange | inverse () const |
| Return a new range that is the logical not of the current set. More... | |
| void | print (raw_ostream &OS) const |
| Print out the bounds to a stream. More... | |
| void | dump () const |
| Allow printing from a debugger easily. More... | |
Static Public Member Functions | |
| static ConstantRange | makeAllowedICmpRegion (CmpInst::Predicate Pred, const ConstantRange &Other) |
| Produce the smallest range such that all values that may satisfy the given predicate with any value contained within Other is contained in the returned range. More... | |
| static ConstantRange | makeSatisfyingICmpRegion (CmpInst::Predicate Pred, const ConstantRange &Other) |
| Produce the largest range such that all values in the returned range satisfy the given predicate with all values contained within Other. More... | |
This class represents a range of values.
Definition at line 43 of file ConstantRange.h.
Initialize a full (the default) or empty set for the specified bit width.
Initialize a full (the default) or empty set for the specified type.
Definition at line 32 of file ConstantRange.cpp.
References llvm::APInt::getMaxValue(), and llvm::APInt::getMinValue().
Referenced by add(), binaryAnd(), binaryOr(), intersectWith(), inverse(), lshr(), makeAllowedICmpRegion(), multiply(), shl(), signExtend(), smax(), sub(), subtract(), truncate(), udiv(), umax(), unionWith(), and zeroExtend().
| ConstantRange::ConstantRange | ( | APIntMoveTy | Value | ) |
Initialize a range to hold the single specified value.
Definition at line 41 of file ConstantRange.cpp.
| ConstantRange::ConstantRange | ( | APIntMoveTy | Lower, |
| APIntMoveTy | Upper | ||
| ) |
Initialize a range of values explicitly.
This will assert out if Lower==Upper and Lower != Min or Max value for its type. It will also assert out if the two APInt's are not the same bit width.
Definition at line 44 of file ConstantRange.cpp.
References llvm::APInt::getBitWidth(), llvm::APInt::isMaxValue(), and llvm::APInt::isMinValue().
| ConstantRange ConstantRange::add | ( | const ConstantRange & | Other | ) | const |
Return a new range representing the possible values resulting from an addition of a value in this range and a value in Other.
Definition at line 550 of file ConstantRange.cpp.
References ConstantRange(), getBitWidth(), getLower(), getSetSize(), getUpper(), isEmptySet(), isFullSet(), llvm::APInt::ult(), and X.
| ConstantRange ConstantRange::binaryAnd | ( | const ConstantRange & | Other | ) | const |
Return a new range representing the possible values resulting from a binary-and of a value in this range by a value in Other.
Definition at line 693 of file ConstantRange.cpp.
References ConstantRange(), getBitWidth(), llvm::APInt::getNullValue(), getUnsignedMax(), llvm::APInt::isAllOnesValue(), isEmptySet(), and llvm::APIntOps::umin().
| ConstantRange ConstantRange::binaryOr | ( | const ConstantRange & | Other | ) | const |
Return a new range representing the possible values resulting from a binary-or of a value in this range by a value in Other.
Definition at line 706 of file ConstantRange.cpp.
References ConstantRange(), getBitWidth(), llvm::APInt::getNullValue(), getUnsignedMin(), isEmptySet(), llvm::APInt::isMinValue(), umax(), and llvm::APIntOps::umax().
Return true if the specified value is in the set.
contains - Return true if the specified value is in the set.
Definition at line 220 of file ConstantRange.cpp.
References isFullSet(), isWrappedSet(), llvm::APInt::ule(), and llvm::APInt::ult().
Referenced by CanBeSMax(), CanBeSMin(), llvm::SCEVAddRecExpr::getNumIterationsInRange(), getPredicateResult(), llvm::ScalarEvolution::getSignExtendExpr(), llvm::ScalarEvolution::getZeroExtendExpr(), isSignWrappedSet(), and SimplifyICmpInst().
| bool ConstantRange::contains | ( | const ConstantRange & | Other | ) | const |
Return true if the other range is a subset of this one.
contains - Return true if the argument is a subset of this range.
Two equal sets contain each other. The empty set contained by all other sets.
Definition at line 233 of file ConstantRange.cpp.
References getLower(), getUpper(), isEmptySet(), isFullSet(), isWrappedSet(), and llvm::APInt::ule().
| ConstantRange ConstantRange::difference | ( | const ConstantRange & | CR | ) | const |
Subtract the specified range from this range (aka relative complement of the sets).
Definition at line 263 of file ConstantRange.cpp.
References intersectWith(), and inverse().
Referenced by getEdgeValueLocal().
| void ConstantRange::dump | ( | ) | const |
Allow printing from a debugger easily.
dump - Allow printing from a debugger easily...
Definition at line 769 of file ConstantRange.cpp.
References llvm::dbgs(), and print().
|
inline |
Get the bit width of this ConstantRange.
Definition at line 95 of file ConstantRange.h.
References llvm::APInt::getBitWidth().
Referenced by add(), binaryAnd(), binaryOr(), getSetSize(), getSignedMax(), getSignedMin(), getUnsignedMax(), getUnsignedMin(), intersectWith(), inverse(), isSignWrappedSet(), lshr(), makeAllowedICmpRegion(), multiply(), sextOrTrunc(), shl(), signExtend(), smax(), sub(), subtract(), truncate(), udiv(), umax(), unionWith(), zeroExtend(), and zextOrTrunc().
Return the lower value for this range.
Definition at line 87 of file ConstantRange.h.
Referenced by add(), contains(), llvm::SCEVAddRecExpr::getNumIterationsInRange(), getSignedMax(), getSignedMin(), getUnsignedMin(), isContiguous(), makeAllowedICmpRegion(), sub(), tryMergeRange(), udiv(), and llvm::InstCombiner::visitICmpInstWithInstAndIntCst().
| APInt ConstantRange::getSetSize | ( | ) | const |
Return the number of elements in this set.
getSetSize - Return the number of elements in this set.
Definition at line 157 of file ConstantRange.cpp.
References getBitWidth(), isFullSet(), llvm::APInt::setBit(), and llvm::APInt::zext().
Referenced by add(), intersectWith(), multiply(), and sub().
| APInt ConstantRange::getSignedMax | ( | ) | const |
Return the largest signed value contained in the ConstantRange.
getSignedMax - Return the largest signed value contained in the ConstantRange.
Definition at line 189 of file ConstantRange.cpp.
References getBitWidth(), getLower(), llvm::APInt::getSignedMaxValue(), getUpper(), and isWrappedSet().
Referenced by getSignedOverflowLimitForStep(), llvm::ScalarEvolution::isKnownNegative(), llvm::ScalarEvolution::isKnownNonPositive(), makeAllowedICmpRegion(), multiply(), llvm::ScalarEvolution::SimplifyICmpOperands(), and smax().
| APInt ConstantRange::getSignedMin | ( | ) | const |
Return the smallest signed value contained in the ConstantRange.
getSignedMin - Return the smallest signed value contained in the ConstantRange.
Definition at line 204 of file ConstantRange.cpp.
References getBitWidth(), getLower(), llvm::APInt::getSignedMinValue(), getUpper(), and isWrappedSet().
Referenced by getSignedOverflowLimitForStep(), llvm::ScalarEvolution::isKnownNonNegative(), llvm::ScalarEvolution::isKnownPositive(), makeAllowedICmpRegion(), multiply(), llvm::ScalarEvolution::SimplifyICmpOperands(), and smax().
If this set contains a single element, return it, otherwise return null.
Definition at line 126 of file ConstantRange.h.
Referenced by llvm::LazyValueInfo::getConstant(), llvm::LazyValueInfo::getConstantOnEdge(), and isSingleElement().
| APInt ConstantRange::getUnsignedMax | ( | ) | const |
Return the largest unsigned value contained in the ConstantRange.
getUnsignedMax - Return the largest unsigned value contained in the ConstantRange.
Definition at line 171 of file ConstantRange.cpp.
References getBitWidth(), llvm::APInt::getMaxValue(), getUpper(), isFullSet(), and isWrappedSet().
Referenced by binaryAnd(), getUnsignedOverflowLimitForStep(), lshr(), makeAllowedICmpRegion(), multiply(), mustBeFiniteCountedLoop(), shl(), llvm::ScalarEvolution::SimplifyICmpOperands(), udiv(), and umax().
| APInt ConstantRange::getUnsignedMin | ( | ) | const |
Return the smallest unsigned value contained in the ConstantRange.
getUnsignedMin - Return the smallest unsigned value contained in the ConstantRange.
Definition at line 180 of file ConstantRange.cpp.
References getBitWidth(), getLower(), llvm::APInt::getMinValue(), getUpper(), isFullSet(), and isWrappedSet().
Referenced by binaryOr(), lshr(), makeAllowedICmpRegion(), multiply(), shl(), llvm::ScalarEvolution::SimplifyICmpOperands(), udiv(), and umax().
Return the upper value for this range.
Definition at line 91 of file ConstantRange.h.
Referenced by add(), contains(), llvm::SCEVAddRecExpr::getNumIterationsInRange(), getSignedMax(), getSignedMin(), getUnsignedMax(), getUnsignedMin(), isContiguous(), makeAllowedICmpRegion(), sub(), tryMergeRange(), udiv(), and llvm::InstCombiner::visitICmpInstWithInstAndIntCst().
| ConstantRange ConstantRange::intersectWith | ( | const ConstantRange & | CR | ) | const |
Return the range that results from the intersection of this range with another range.
intersectWith - Return the range that results from the intersection of this range with another range.
The resultant range is guaranteed to include all elements contained in both input ranges, and to have the smallest possible set size that does so. Because there may be two intersections with the same set size, A.intersectWith(B) might not be equal to B.intersectWith(A).
Definition at line 272 of file ConstantRange.cpp.
References ConstantRange(), getBitWidth(), getSetSize(), intersectWith(), isEmptySet(), isFullSet(), isWrappedSet(), llvm::APInt::ule(), and llvm::APInt::ult().
Referenced by canBeMerged(), difference(), llvm::InstCombiner::FoldAndOfICmps(), and intersectWith().
| ConstantRange ConstantRange::inverse | ( | ) | const |
Return a new range that is the logical not of the current set.
Definition at line 748 of file ConstantRange.cpp.
References ConstantRange(), getBitWidth(), isEmptySet(), and isFullSet().
Referenced by difference(), getPredicateResult(), getValueFromFromCondition(), makeSatisfyingICmpRegion(), and SimplifyICmpInst().
| bool ConstantRange::isEmptySet | ( | ) | const |
Return true if this set contains no members.
isEmptySet - Return true if this set contains no members.
Definition at line 136 of file ConstantRange.cpp.
References llvm::APInt::isMinValue().
Referenced by add(), binaryAnd(), binaryOr(), canBeMerged(), contains(), llvm::InstCombiner::FoldAndOfICmps(), intersectWith(), inverse(), lshr(), makeAllowedICmpRegion(), multiply(), print(), shl(), signExtend(), SimplifyICmpInst(), smax(), sub(), truncate(), udiv(), umax(), unionWith(), and zeroExtend().
| bool ConstantRange::isFullSet | ( | ) | const |
Return true if this set contains all of the elements possible for this data-type.
isFullSet - Return true if this set contains all of the elements possible for this data-type
Definition at line 130 of file ConstantRange.cpp.
References llvm::APInt::isMaxValue().
Referenced by add(), contains(), llvm::MDNode::getMostGenericRange(), llvm::SCEVAddRecExpr::getNumIterationsInRange(), getSetSize(), getUnsignedMax(), getUnsignedMin(), intersectWith(), inverse(), print(), signExtend(), SimplifyICmpInst(), sub(), truncate(), udiv(), unionWith(), and zeroExtend().
| bool ConstantRange::isSignWrappedSet | ( | ) | const |
Return true if this set wraps around the INT_MIN of its bitwidth.
isSignWrappedSet - Return true if this set wraps around the INT_MIN of its bitwidth, for example: i8 [120, 140).
For example: i8 [120, 140).
Definition at line 150 of file ConstantRange.cpp.
References contains(), getBitWidth(), llvm::APInt::getSignedMaxValue(), and llvm::APInt::getSignedMinValue().
Referenced by signExtend().
|
inline |
Return true if this set contains exactly one member.
Definition at line 134 of file ConstantRange.h.
References getSingleElement().
Referenced by getPredicateResult(), and makeAllowedICmpRegion().
| bool ConstantRange::isWrappedSet | ( | ) | const |
Return true if this set wraps around the top of the range.
isWrappedSet - Return true if this set wraps around the top of the range, for example: [100, 8)
For example: [100, 8).
Definition at line 143 of file ConstantRange.cpp.
References llvm::APInt::ugt().
Referenced by contains(), getSignedMax(), getSignedMin(), getUnsignedMax(), getUnsignedMin(), intersectWith(), truncate(), unionWith(), and zeroExtend().
| ConstantRange ConstantRange::lshr | ( | const ConstantRange & | Other | ) | const |
Return a new range representing the possible values resulting from a logical right shift of a value in this range and a value in Other.
Definition at line 736 of file ConstantRange.cpp.
References ConstantRange(), getBitWidth(), getUnsignedMax(), getUnsignedMin(), isEmptySet(), llvm::APInt::lshr(), and fuzzer::min().
|
static |
Produce the smallest range such that all values that may satisfy the given predicate with any value contained within Other is contained in the returned range.
Formally, this returns a superset of 'union over all y in Other . { x : icmp op x y is true }'. If the exact answer is not representable as a ConstantRange, the return value will be a proper superset of the above.
Example: Pred = ult and Other = i8 [2, 5) returns Result = [0, 4)
Definition at line 52 of file ConstantRange.cpp.
References ConstantRange(), getBitWidth(), getLower(), llvm::APInt::getMinValue(), llvm::APInt::getNullValue(), getSignedMax(), getSignedMin(), llvm::APInt::getSignedMinValue(), getUnsignedMax(), getUnsignedMin(), getUpper(), llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_UGE, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, isEmptySet(), isSingleElement(), and llvm_unreachable.
Referenced by llvm::InstCombiner::FoldAndOfICmps(), getValueFromFromCondition(), and makeSatisfyingICmpRegion().
|
static |
Produce the largest range such that all values in the returned range satisfy the given predicate with all values contained within Other.
Formally, this returns a subset of 'intersection over all y in Other . { x : icmp op x y is true }'. If the exact answer is not representable as a ConstantRange, the return value will be a proper subset of the above.
Example: Pred = ult and Other = i8 [2, 5) returns [0, 2)
Definition at line 118 of file ConstantRange.cpp.
References llvm::CmpInst::getInversePredicate(), inverse(), and makeAllowedICmpRegion().
| ConstantRange ConstantRange::multiply | ( | const ConstantRange & | Other | ) | const |
Return a new range representing the possible values resulting from a multiplication of a value in this range and a value in Other, treating both this and Other as unsigned ranges.
Definition at line 592 of file ConstantRange.cpp.
References llvm::ARM_PROC::A, llvm::MCID::Compare, ConstantRange(), getBitWidth(), getSetSize(), getSignedMax(), getSignedMin(), getUnsignedMax(), getUnsignedMin(), isEmptySet(), fuzzer::min(), llvm::APInt::sext(), llvm::APInt::slt(), truncate(), llvm::APInt::ult(), and llvm::APInt::zext().
|
inline |
Definition at line 161 of file ConstantRange.h.
References operator==().
|
inline |
Return true if this range is equal to another range.
Definition at line 158 of file ConstantRange.h.
Referenced by operator!=().
| void ConstantRange::print | ( | raw_ostream & | OS | ) | const |
Print out the bounds to a stream.
print - Print out the bounds to a stream...
Definition at line 758 of file ConstantRange.cpp.
References isEmptySet(), and isFullSet().
Referenced by dump(), llvm::operator<<(), and llvm::ScalarEvolution::print().
| ConstantRange ConstantRange::sextOrTrunc | ( | uint32_t | DstTySize | ) | const |
Make this range have the bit width given by BitWidth.
sextOrTrunc - make this range have the bit width given by DstTySize.
The value is sign extended, truncated, or left alone to make it that width.
Definition at line 540 of file ConstantRange.cpp.
References getBitWidth(), signExtend(), and truncate().
Referenced by llvm::ScalarEvolution::getSignExtendExpr().
| ConstantRange ConstantRange::shl | ( | const ConstantRange & | Other | ) | const |
Return a new range representing the possible values resulting from a left shift of a value in this range by a value in Other.
TODO: This isn't fully implemented yet.
Definition at line 719 of file ConstantRange.cpp.
References ConstantRange(), llvm::countLeadingZeros(), getBitWidth(), getUnsignedMax(), getUnsignedMin(), isEmptySet(), fuzzer::min(), llvm::APInt::shl(), and llvm::APInt::ugt().
| ConstantRange ConstantRange::signExtend | ( | uint32_t | DstTySize | ) | const |
Return a new range in the specified integer type, which must be strictly larger than the current type.
signExtend - 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 sign extended to BitWidth.
The returned range will correspond to the possible range of values as if the source range had been sign extended.
Definition at line 454 of file ConstantRange.cpp.
References ConstantRange(), getBitWidth(), llvm::APInt::getHighBitsSet(), llvm::APInt::getLowBitsSet(), isEmptySet(), isFullSet(), llvm::APInt::isMinSignedValue(), isSignWrappedSet(), llvm::APInt::sext(), and llvm::APInt::zext().
Referenced by llvm::ScalarEvolution::getSignExtendExpr(), and sextOrTrunc().
| ConstantRange ConstantRange::smax | ( | const ConstantRange & | Other | ) | const |
Return a new range representing the possible values resulting from a signed maximum of a value in this range and a value in Other.
Definition at line 638 of file ConstantRange.cpp.
References ConstantRange(), getBitWidth(), getSignedMax(), getSignedMin(), isEmptySet(), and llvm::APIntOps::smax().
| ConstantRange ConstantRange::sub | ( | const ConstantRange & | Other | ) | const |
Return a new range representing the possible values resulting from a subtraction of a value in this range and a value in Other.
Definition at line 571 of file ConstantRange.cpp.
References ConstantRange(), getBitWidth(), getLower(), getSetSize(), getUpper(), isEmptySet(), isFullSet(), llvm::APInt::ult(), and X.
| ConstantRange ConstantRange::subtract | ( | const APInt & | Val | ) | const |
Subtract the specified constant from the endpoints of this constant range.
subtract - Subtract the specified constant from the endpoints of this constant range.
Definition at line 253 of file ConstantRange.cpp.
References ConstantRange(), getBitWidth(), and llvm::APInt::getBitWidth().
Referenced by llvm::SCEVAddRecExpr::getNumIterationsInRange(), and getValueFromFromCondition().
| ConstantRange ConstantRange::truncate | ( | uint32_t | DstTySize | ) | const |
Return a new range in the specified integer type, which must be strictly smaller than the current type.
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.
The returned range will correspond to the possible range of values as if the source range had been truncated to the specified type.
Definition at line 476 of file ConstantRange.cpp.
References ConstantRange(), getBitWidth(), llvm::APInt::getMaxValue(), isEmptySet(), isFullSet(), isWrappedSet(), llvm::APInt::setBit(), llvm::APInt::trunc(), llvm::APInt::udivrem(), llvm::APInt::uge(), llvm::APInt::ule(), llvm::APInt::ult(), llvm::Union, unionWith(), and llvm::APInt::zext().
Referenced by llvm::ScalarEvolution::getSignExtendExpr(), llvm::ScalarEvolution::getZeroExtendExpr(), multiply(), sextOrTrunc(), and zextOrTrunc().
| ConstantRange ConstantRange::udiv | ( | const ConstantRange & | Other | ) | const |
Return a new range representing the possible values resulting from an unsigned division of a value in this range and a value in Other.
Definition at line 664 of file ConstantRange.cpp.
References ConstantRange(), getBitWidth(), getLower(), getUnsignedMax(), getUnsignedMin(), getUpper(), isEmptySet(), isFullSet(), and llvm::APInt::udiv().
| ConstantRange ConstantRange::umax | ( | const ConstantRange & | Other | ) | const |
Return a new range representing the possible values resulting from an unsigned maximum of a value in this range and a value in Other.
Definition at line 651 of file ConstantRange.cpp.
References ConstantRange(), getBitWidth(), getUnsignedMax(), getUnsignedMin(), isEmptySet(), and llvm::APIntOps::umax().
Referenced by binaryOr().
| ConstantRange ConstantRange::unionWith | ( | const ConstantRange & | CR | ) | const |
Return the range that results from the union of this range with another range.
unionWith - 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 353 of file ConstantRange.cpp.
References ConstantRange(), getBitWidth(), if(), isEmptySet(), isFullSet(), isWrappedSet(), llvm::APInt::uge(), llvm::APInt::ugt(), llvm::APInt::ule(), llvm::APInt::ult(), and unionWith().
Referenced by getEdgeValueLocal(), GetRangeFromMetadata(), truncate(), tryMergeRange(), and unionWith().
| ConstantRange ConstantRange::zeroExtend | ( | uint32_t | DstTySize | ) | const |
Return a new range in the specified integer type, which must be strictly larger than the current type.
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 to BitWidth.
The returned range will correspond to the possible range of values as if the source range had been zero extended.
Definition at line 434 of file ConstantRange.cpp.
References ConstantRange(), getBitWidth(), llvm::APInt::getOneBitSet(), isEmptySet(), isFullSet(), isWrappedSet(), and llvm::APInt::zext().
Referenced by llvm::ScalarEvolution::getZeroExtendExpr(), and zextOrTrunc().
| ConstantRange ConstantRange::zextOrTrunc | ( | uint32_t | DstTySize | ) | const |
Make this range have the bit width given by BitWidth.
zextOrTrunc - make this range have the bit width given by DstTySize.
The value is zero extended, truncated, or left alone to make it that width.
Definition at line 529 of file ConstantRange.cpp.
References getBitWidth(), truncate(), and zeroExtend().
Referenced by llvm::ScalarEvolution::getZeroExtendExpr().
1.8.6