class ConstantRange
Declaration
class ConstantRange { /* full declaration omitted */ };
Description
This class represents a range of values.
Declared at: llvm/include/llvm/IR/ConstantRange.h:47
Member Variables
- private llvm::APInt Lower
- private llvm::APInt Upper
Method Overview
- public ConstantRange(uint32_t BitWidth, bool isFullSet)
- public ConstantRange(llvm::APInt Value)
- public ConstantRange(llvm::APInt Lower, llvm::APInt Upper)
- public llvm::ConstantRange abs(bool IntMinIsPoison = false) const
- public llvm::ConstantRange add(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange addWithNoWrap(const llvm::ConstantRange & Other, unsigned int NoWrapKind, llvm::ConstantRange::PreferredRangeType RangeType = Smallest) const
- public static bool areInsensitiveToSignednessOfICmpPredicate(const llvm::ConstantRange & CR1, const llvm::ConstantRange & CR2)
- public static bool areInsensitiveToSignednessOfInvertedICmpPredicate(const llvm::ConstantRange & CR1, const llvm::ConstantRange & CR2)
- public llvm::ConstantRange ashr(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange binaryAnd(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange binaryNot() const
- public llvm::ConstantRange binaryOp(Instruction::BinaryOps BinOp, const llvm::ConstantRange & Other) const
- public llvm::ConstantRange binaryOr(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange binaryXor(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange castOp(Instruction::CastOps CastOp, uint32_t BitWidth) const
- public bool contains(const llvm::APInt & Val) const
- public bool contains(const llvm::ConstantRange & CR) const
- public llvm::ConstantRange difference(const llvm::ConstantRange & CR) const
- public void dump() const
- public Optional<llvm::ConstantRange> exactIntersectWith(const llvm::ConstantRange & CR) const
- public Optional<llvm::ConstantRange> exactUnionWith(const llvm::ConstantRange & CR) const
- public static llvm::ConstantRange fromKnownBits(const llvm::KnownBits & Known, bool IsSigned)
- public unsigned int getActiveBits() const
- public uint32_t getBitWidth() const
- private llvm::ConstantRange getEmpty() const
- public static llvm::ConstantRange getEmpty(uint32_t BitWidth)
- public void getEquivalentICmp(CmpInst::Predicate & Pred, llvm::APInt & RHS, llvm::APInt & Offset) const
- public bool getEquivalentICmp(CmpInst::Predicate & Pred, llvm::APInt & RHS) const
- public static CmpInst::Predicate getEquivalentPredWithFlippedSignedness(CmpInst::Predicate Pred, const llvm::ConstantRange & CR1, const llvm::ConstantRange & CR2)
- private llvm::ConstantRange getFull() const
- public static llvm::ConstantRange getFull(uint32_t BitWidth)
- public const llvm::APInt & getLower() const
- public unsigned int getMinSignedBits() const
- public static llvm::ConstantRange getNonEmpty(llvm::APInt Lower, llvm::APInt Upper)
- public llvm::APInt getSignedMax() const
- public llvm::APInt getSignedMin() const
- public const llvm::APInt * getSingleElement() const
- public const llvm::APInt * getSingleMissingElement() const
- public llvm::APInt getUnsignedMax() const
- public llvm::APInt getUnsignedMin() const
- public const llvm::APInt & getUpper() const
- public bool icmp(CmpInst::Predicate Pred, const llvm::ConstantRange & Other) const
- public llvm::ConstantRange intersectWith(const llvm::ConstantRange & CR, llvm::ConstantRange::PreferredRangeType Type = Smallest) const
- public static llvm::ConstantRange intrinsic(Intrinsic::ID IntrinsicID, ArrayRef<llvm::ConstantRange> Ops)
- public llvm::ConstantRange inverse() const
- public bool isAllNegative() const
- public bool isAllNonNegative() const
- public bool isEmptySet() const
- public bool isFullSet() const
- public static bool isIntrinsicSupported(Intrinsic::ID IntrinsicID)
- public bool isSignWrappedSet() const
- public bool isSingleElement() const
- public bool isSizeLargerThan(uint64_t MaxSize) const
- public bool isSizeStrictlySmallerThan(const llvm::ConstantRange & CR) const
- public bool isUpperSignWrapped() const
- public bool isUpperWrapped() const
- public bool isWrappedSet() const
- public llvm::ConstantRange lshr(const llvm::ConstantRange & Other) const
- public static llvm::ConstantRange makeAllowedICmpRegion(CmpInst::Predicate Pred, const llvm::ConstantRange & Other)
- public static llvm::ConstantRange makeExactICmpRegion(CmpInst::Predicate Pred, const llvm::APInt & Other)
- public static llvm::ConstantRange makeExactNoWrapRegion(Instruction::BinaryOps BinOp, const llvm::APInt & Other, unsigned int NoWrapKind)
- public static llvm::ConstantRange makeGuaranteedNoWrapRegion(Instruction::BinaryOps BinOp, const llvm::ConstantRange & Other, unsigned int NoWrapKind)
- public static llvm::ConstantRange makeSatisfyingICmpRegion(CmpInst::Predicate Pred, const llvm::ConstantRange & Other)
- public llvm::ConstantRange multiply(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange overflowingBinaryOp(Instruction::BinaryOps BinOp, const llvm::ConstantRange & Other, unsigned int NoWrapKind) const
- public void print(llvm::raw_ostream & OS) const
- public llvm::ConstantRange sadd_sat(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange sdiv(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange sextOrTrunc(uint32_t BitWidth) const
- public llvm::ConstantRange shl(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange signExtend(uint32_t BitWidth) const
- public llvm::ConstantRange::OverflowResult signedAddMayOverflow(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange::OverflowResult signedSubMayOverflow(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange smax(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange smin(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange smul_fast(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange smul_sat(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange srem(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange sshl_sat(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange ssub_sat(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange sub(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange subWithNoWrap(const llvm::ConstantRange & Other, unsigned int NoWrapKind, llvm::ConstantRange::PreferredRangeType RangeType = Smallest) const
- public llvm::ConstantRange subtract(const llvm::APInt & CI) const
- public llvm::KnownBits toKnownBits() const
- public llvm::ConstantRange truncate(uint32_t BitWidth) const
- public llvm::ConstantRange uadd_sat(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange udiv(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange umax(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange umin(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange umul_sat(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange unionWith(const llvm::ConstantRange & CR, llvm::ConstantRange::PreferredRangeType Type = Smallest) const
- public llvm::ConstantRange::OverflowResult unsignedAddMayOverflow(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange::OverflowResult unsignedMulMayOverflow(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange::OverflowResult unsignedSubMayOverflow(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange urem(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange ushl_sat(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange usub_sat(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange zeroExtend(uint32_t BitWidth) const
- public llvm::ConstantRange zextOrTrunc(uint32_t BitWidth) const
Methods
¶ConstantRange(uint32_t BitWidth, bool isFullSet)
ConstantRange(uint32_t BitWidth, bool isFullSet)
Description
Initialize a full or empty set for the specified bit width.
Declared at: llvm/include/llvm/IR/ConstantRange.h:62
Parameters
- uint32_t BitWidth
- bool isFullSet
¶ConstantRange(llvm::APInt Value)
ConstantRange(llvm::APInt Value)
Description
Initialize a range to hold the single specified value.
Declared at: llvm/include/llvm/IR/ConstantRange.h:65
Parameters
- llvm::APInt Value
¶ConstantRange(llvm::APInt Lower,
llvm::APInt Upper)
ConstantRange(llvm::APInt Lower,
llvm::APInt Upper)
Description
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.
Declared at: llvm/include/llvm/IR/ConstantRange.h:70
Parameters
- llvm::APInt Lower
- llvm::APInt Upper
¶llvm::ConstantRange abs(
bool IntMinIsPoison = false) const
llvm::ConstantRange abs(
bool IntMinIsPoison = false) const
Description
Calculate absolute value range. If the original range contains signed min, then the resulting range will contain signed min if and only if\p IntMinIsPoison is false.
Declared at: llvm/include/llvm/IR/ConstantRange.h:526
Parameters
- bool IntMinIsPoison = false
¶llvm::ConstantRange add(
const llvm::ConstantRange& Other) const
llvm::ConstantRange add(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from an addition of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:394
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange addWithNoWrap(
const llvm::ConstantRange& Other,
unsigned int NoWrapKind,
llvm::ConstantRange::PreferredRangeType
RangeType = Smallest) const
llvm::ConstantRange addWithNoWrap(
const llvm::ConstantRange& Other,
unsigned int NoWrapKind,
llvm::ConstantRange::PreferredRangeType
RangeType = Smallest) const
Description
Return a new range representing the possible values resulting from an addition with wrap type \p NoWrapKind of a value in this range and a value in \p Other. If the result range is disjoint, the preferred range is determined by the\p PreferredRangeType.
Declared at: llvm/include/llvm/IR/ConstantRange.h:401
Parameters
- const llvm::ConstantRange& Other
- unsigned int NoWrapKind
- llvm::ConstantRange::PreferredRangeType RangeType = Smallest
¶static bool
areInsensitiveToSignednessOfICmpPredicate(
const llvm::ConstantRange& CR1,
const llvm::ConstantRange& CR2)
static bool
areInsensitiveToSignednessOfICmpPredicate(
const llvm::ConstantRange& CR1,
const llvm::ConstantRange& CR2)
Description
Return true iff CR1 ult CR2 is equivalent to CR1 slt CR2. Does not depend on strictness/direction of the predicate.
Declared at: llvm/include/llvm/IR/ConstantRange.h:134
Parameters
- const llvm::ConstantRange& CR1
- const llvm::ConstantRange& CR2
¶static bool
areInsensitiveToSignednessOfInvertedICmpPredicate(
const llvm::ConstantRange& CR1,
const llvm::ConstantRange& CR2)
static bool
areInsensitiveToSignednessOfInvertedICmpPredicate(
const llvm::ConstantRange& CR1,
const llvm::ConstantRange& CR2)
Description
Return true iff CR1 ult CR2 is equivalent to CR1 sge CR2. Does not depend on strictness/direction of the predicate.
Declared at: llvm/include/llvm/IR/ConstantRange.h:140
Parameters
- const llvm::ConstantRange& CR1
- const llvm::ConstantRange& CR2
¶llvm::ConstantRange ashr(
const llvm::ConstantRange& Other) const
llvm::ConstantRange ashr(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a arithmetic right shift of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:492
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange binaryAnd(
const llvm::ConstantRange& Other) const
llvm::ConstantRange binaryAnd(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a binary-and of a value in this range by a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:471
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange binaryNot() const
llvm::ConstantRange binaryNot() const
Description
Return a new range representing the possible values resulting from a binary-xor of a value in this range by an all-one value, aka bitwise complement operation.
Declared at: llvm/include/llvm/IR/ConstantRange.h:467
¶llvm::ConstantRange binaryOp(
Instruction::BinaryOps BinOp,
const llvm::ConstantRange& Other) const
llvm::ConstantRange binaryOp(
Instruction::BinaryOps BinOp,
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from an application of the specified binary operator to an left hand side of this range and a right hand side of \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:381
Parameters
- Instruction::BinaryOps BinOp
- const llvm::ConstantRange& Other
¶llvm::ConstantRange binaryOr(
const llvm::ConstantRange& Other) const
llvm::ConstantRange binaryOr(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a binary-or of a value in this range by a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:475
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange binaryXor(
const llvm::ConstantRange& Other) const
llvm::ConstantRange binaryXor(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a binary-xor of a value in this range by a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:479
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange castOp(
Instruction::CastOps CastOp,
uint32_t BitWidth) const
llvm::ConstantRange castOp(
Instruction::CastOps CastOp,
uint32_t BitWidth) const
Description
Return a new range representing the possible values resulting from an application of the specified cast operator to this range. \p BitWidth is the target bitwidth of the cast. For casts which don't change bitwidth, it must be the same as the source bitwidth. For casts which do change bitwidth, the bitwidth must be consistent with the requested cast and source bitwidth.
Declared at: llvm/include/llvm/IR/ConstantRange.h:349
Parameters
- Instruction::CastOps CastOp
- uint32_t BitWidth
¶bool contains(const llvm::APInt& Val) const
bool contains(const llvm::APInt& Val) const
Description
Return true if the specified value is in the set.
Declared at: llvm/include/llvm/IR/ConstantRange.h:240
Parameters
- const llvm::APInt& Val
¶bool contains(const llvm::ConstantRange& CR) const
bool contains(const llvm::ConstantRange& CR) const
Description
Return true if the other range is a subset of this one.
Declared at: llvm/include/llvm/IR/ConstantRange.h:243
Parameters
- const llvm::ConstantRange& CR
¶llvm::ConstantRange difference(
const llvm::ConstantRange& CR) const
llvm::ConstantRange difference(
const llvm::ConstantRange& CR) const
Description
Subtract the specified range from this range (aka relative complement of the sets).
Declared at: llvm/include/llvm/IR/ConstantRange.h:308
Parameters
- const llvm::ConstantRange& CR
¶void dump() const
void dump() const
Description
Allow printing from a debugger easily.
Declared at: llvm/include/llvm/IR/ConstantRange.h:563
¶Optional<llvm::ConstantRange> exactIntersectWith(
const llvm::ConstantRange& CR) const
Optional<llvm::ConstantRange> exactIntersectWith(
const llvm::ConstantRange& CR) const
Description
Intersect the two ranges and return the result if it can be represented exactly, otherwise return None.
Declared at: llvm/include/llvm/IR/ConstantRange.h:337
Parameters
- const llvm::ConstantRange& CR
¶Optional<llvm::ConstantRange> exactUnionWith(
const llvm::ConstantRange& CR) const
Optional<llvm::ConstantRange> exactUnionWith(
const llvm::ConstantRange& CR) const
Description
Union the two ranges and return the result if it can be represented exactly, otherwise return None.
Declared at: llvm/include/llvm/IR/ConstantRange.h:341
Parameters
- const llvm::ConstantRange& CR
¶static llvm::ConstantRange fromKnownBits(
const llvm::KnownBits& Known,
bool IsSigned)
static llvm::ConstantRange fromKnownBits(
const llvm::KnownBits& Known,
bool IsSigned)
Description
Initialize a range based on a known bits constraint. The IsSigned flag indicates whether the constant range should not wrap in the signed or unsigned domain.
Declared at: llvm/include/llvm/IR/ConstantRange.h:93
Parameters
- const llvm::KnownBits& Known
- bool IsSigned
¶unsigned int getActiveBits() const
unsigned int getActiveBits() const
Description
Compute the maximal number of active bits needed to represent every value in this range.
Declared at: llvm/include/llvm/IR/ConstantRange.h:297
¶uint32_t getBitWidth() const
uint32_t getBitWidth() const
Description
Get the bit width of this ConstantRange.
Declared at: llvm/include/llvm/IR/ConstantRange.h:204
¶llvm::ConstantRange getEmpty() const
llvm::ConstantRange getEmpty() const
Description
Create empty constant range with same bitwidth.
Declared at: llvm/include/llvm/IR/ConstantRange.h:51
¶static llvm::ConstantRange getEmpty(
uint32_t BitWidth)
static llvm::ConstantRange getEmpty(
uint32_t BitWidth)
Description
Create empty constant range with the given bit width.
Declared at: llvm/include/llvm/IR/ConstantRange.h:73
Parameters
- uint32_t BitWidth
¶void getEquivalentICmp(CmpInst::Predicate& Pred,
llvm::APInt& RHS,
llvm::APInt& Offset) const
void getEquivalentICmp(CmpInst::Predicate& Pred,
llvm::APInt& RHS,
llvm::APInt& Offset) const
Description
Set up \p Pred, \p RHS and \p Offset such that (V + Offset) Pred RHS is true iff V is in the range. Prefers using Offset == 0 if possible.
Declared at: llvm/include/llvm/IR/ConstantRange.h:195
Parameters
- CmpInst::Predicate& Pred
- llvm::APInt& RHS
- llvm::APInt& Offset
¶bool getEquivalentICmp(CmpInst::Predicate& Pred,
llvm::APInt& RHS) const
bool getEquivalentICmp(CmpInst::Predicate& Pred,
llvm::APInt& RHS) const
Description
Set up \p Pred and \p RHS such that ConstantRange::makeExactICmpRegion(Pred, RHS) == *this. Return true if successful.
Declared at: llvm/include/llvm/IR/ConstantRange.h:190
Parameters
- CmpInst::Predicate& Pred
- llvm::APInt& RHS
¶static CmpInst::Predicate
getEquivalentPredWithFlippedSignedness(
CmpInst::Predicate Pred,
const llvm::ConstantRange& CR1,
const llvm::ConstantRange& CR2)
static CmpInst::Predicate
getEquivalentPredWithFlippedSignedness(
CmpInst::Predicate Pred,
const llvm::ConstantRange& CR1,
const llvm::ConstantRange& CR2)
Description
If the comparison between constant ranges this and Other is insensitive to the signedness of the comparison predicate, return a predicate equivalent to \p Pred, with flipped signedness (i.e. unsigned instead of signed or vice versa), and maybe inverted, otherwise returns CmpInst::Predicate::BAD_ICMP_PREDICATE.
Declared at: llvm/include/llvm/IR/ConstantRange.h:149
Parameters
- CmpInst::Predicate Pred
- const llvm::ConstantRange& CR1
- const llvm::ConstantRange& CR2
¶llvm::ConstantRange getFull() const
llvm::ConstantRange getFull() const
Description
Create full constant range with same bitwidth.
Declared at: llvm/include/llvm/IR/ConstantRange.h:56
¶static llvm::ConstantRange getFull(
uint32_t BitWidth)
static llvm::ConstantRange getFull(
uint32_t BitWidth)
Description
Create full constant range with the given bit width.
Declared at: llvm/include/llvm/IR/ConstantRange.h:78
Parameters
- uint32_t BitWidth
¶const llvm::APInt& getLower() const
const llvm::APInt& getLower() const
Description
Return the lower value for this range.
Declared at: llvm/include/llvm/IR/ConstantRange.h:198
¶unsigned int getMinSignedBits() const
unsigned int getMinSignedBits() const
Description
Compute the maximal number of bits needed to represent every value in this signed range.
Declared at: llvm/include/llvm/IR/ConstantRange.h:301
¶static llvm::ConstantRange getNonEmpty(
llvm::APInt Lower,
llvm::APInt Upper)
static llvm::ConstantRange getNonEmpty(
llvm::APInt Lower,
llvm::APInt Upper)
Description
Create non-empty constant range with the given bounds. If Lower and Upper are the same, a full range is returned.
Declared at: llvm/include/llvm/IR/ConstantRange.h:84
Parameters
- llvm::APInt Lower
- llvm::APInt Upper
¶llvm::APInt getSignedMax() const
llvm::APInt getSignedMax() const
Description
Return the largest signed value contained in the ConstantRange.
Declared at: llvm/include/llvm/IR/ConstantRange.h:282
¶llvm::APInt getSignedMin() const
llvm::APInt getSignedMin() const
Description
Return the smallest signed value contained in the ConstantRange.
Declared at: llvm/include/llvm/IR/ConstantRange.h:285
¶const llvm::APInt* getSingleElement() const
const llvm::APInt* getSingleElement() const
Description
If this set contains a single element, return it, otherwise return null.
Declared at: llvm/include/llvm/IR/ConstantRange.h:246
¶const llvm::APInt* getSingleMissingElement() const
const llvm::APInt* getSingleMissingElement() const
Description
If this set contains all but a single element, return it, otherwise return null.
Declared at: llvm/include/llvm/IR/ConstantRange.h:254
¶llvm::APInt getUnsignedMax() const
llvm::APInt getUnsignedMax() const
Description
Return the largest unsigned value contained in the ConstantRange.
Declared at: llvm/include/llvm/IR/ConstantRange.h:276
¶llvm::APInt getUnsignedMin() const
llvm::APInt getUnsignedMin() const
Description
Return the smallest unsigned value contained in the ConstantRange.
Declared at: llvm/include/llvm/IR/ConstantRange.h:279
¶const llvm::APInt& getUpper() const
const llvm::APInt& getUpper() const
Description
Return the upper value for this range.
Declared at: llvm/include/llvm/IR/ConstantRange.h:201
¶bool icmp(CmpInst::Predicate Pred,
const llvm::ConstantRange& Other) const
bool icmp(CmpInst::Predicate Pred,
const llvm::ConstantRange& Other) const
Description
Does the predicate \p Pred hold between ranges this and \p Other? NOTE: false does not mean that inverse predicate holds!
Declared at: llvm/include/llvm/IR/ConstantRange.h:129
Parameters
- CmpInst::Predicate Pred
- const llvm::ConstantRange& Other
¶llvm::ConstantRange intersectWith(
const llvm::ConstantRange& CR,
llvm::ConstantRange::PreferredRangeType Type =
Smallest) const
llvm::ConstantRange intersectWith(
const llvm::ConstantRange& CR,
llvm::ConstantRange::PreferredRangeType Type =
Smallest) const
Description
Return the range that results from the intersection of this range with another range. If the intersection is disjoint, such that two results are possible, the preferred range is determined by the PreferredRangeType.
Declared at: llvm/include/llvm/IR/ConstantRange.h:324
Parameters
- const llvm::ConstantRange& CR
- llvm::ConstantRange::PreferredRangeType Type = Smallest
¶static llvm::ConstantRange intrinsic(
Intrinsic::ID IntrinsicID,
ArrayRef<llvm::ConstantRange> Ops)
static llvm::ConstantRange intrinsic(
Intrinsic::ID IntrinsicID,
ArrayRef<llvm::ConstantRange> Ops)
Description
Compute range of intrinsic result for the given operand ranges.
Declared at: llvm/include/llvm/IR/ConstantRange.h:184
Parameters
- Intrinsic::ID IntrinsicID
- ArrayRef<llvm::ConstantRange> Ops
¶llvm::ConstantRange inverse() const
llvm::ConstantRange inverse() const
Description
Return a new range that is the logical not of the current set.
Declared at: llvm/include/llvm/IR/ConstantRange.h:521
¶bool isAllNegative() const
bool isAllNegative() const
Description
Return true if all values in this range are negative.
Declared at: llvm/include/llvm/IR/ConstantRange.h:270
¶bool isAllNonNegative() const
bool isAllNonNegative() const
Description
Return true if all values in this range are non-negative.
Declared at: llvm/include/llvm/IR/ConstantRange.h:273
¶bool isEmptySet() const
bool isEmptySet() const
Description
Return true if this set contains no members.
Declared at: llvm/include/llvm/IR/ConstantRange.h:211
¶bool isFullSet() const
bool isFullSet() const
Description
Return true if this set contains all of the elements possible for this data-type.
Declared at: llvm/include/llvm/IR/ConstantRange.h:208
¶static bool isIntrinsicSupported(
Intrinsic::ID IntrinsicID)
static bool isIntrinsicSupported(
Intrinsic::ID IntrinsicID)
Description
Returns true if ConstantRange calculations are supported for intrinsic with \p IntrinsicID.
Declared at: llvm/include/llvm/IR/ConstantRange.h:181
Parameters
- Intrinsic::ID IntrinsicID
¶bool isSignWrappedSet() const
bool isSignWrappedSet() const
Description
Return true if this set wraps around the signed domain. Special cases: * Empty set: Not wrapped. * Full set: Not wrapped. * [X, SignedMin) == [X, SignedMax]: Not wrapped.
Declared at: llvm/include/llvm/IR/ConstantRange.h:230
¶bool isSingleElement() const
bool isSingleElement() const
Description
Return true if this set contains exactly one member.
Declared at: llvm/include/llvm/IR/ConstantRange.h:261
¶bool isSizeLargerThan(uint64_t MaxSize) const
bool isSizeLargerThan(uint64_t MaxSize) const
Description
Compare set size of this range with Value.
Declared at: llvm/include/llvm/IR/ConstantRange.h:267
Parameters
- uint64_t MaxSize
¶bool isSizeStrictlySmallerThan(
const llvm::ConstantRange& CR) const
bool isSizeStrictlySmallerThan(
const llvm::ConstantRange& CR) const
Description
Compare set size of this range with the range CR.
Declared at: llvm/include/llvm/IR/ConstantRange.h:264
Parameters
- const llvm::ConstantRange& CR
¶bool isUpperSignWrapped() const
bool isUpperSignWrapped() const
Description
Return true if the (exclusive) upper bound wraps around the signed domain. Special cases: * Empty set: Not wrapped. * Full set: Not wrapped. * [X, SignedMin): Wrapped.
Declared at: llvm/include/llvm/IR/ConstantRange.h:237
¶bool isUpperWrapped() const
bool isUpperWrapped() const
Description
Return true if the exclusive upper bound wraps around the unsigned domain. Special cases: * Empty set: Not wrapped. * Full set: Not wrapped. * [X, 0): Wrapped.
Declared at: llvm/include/llvm/IR/ConstantRange.h:224
¶bool isWrappedSet() const
bool isWrappedSet() const
Description
Return true if this set wraps around the unsigned domain. Special cases: * Empty set: Not wrapped. * Full set: Not wrapped. * [X, 0) == [X, Max]: Not wrapped.
Declared at: llvm/include/llvm/IR/ConstantRange.h:217
¶llvm::ConstantRange lshr(
const llvm::ConstantRange& Other) const
llvm::ConstantRange lshr(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a logical right shift of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:488
Parameters
- const llvm::ConstantRange& Other
¶static llvm::ConstantRange makeAllowedICmpRegion(
CmpInst::Predicate Pred,
const llvm::ConstantRange& Other)
static llvm::ConstantRange makeAllowedICmpRegion(
CmpInst::Predicate Pred,
const llvm::ConstantRange& Other)
Description
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)
Declared at: llvm/include/llvm/IR/ConstantRange.h:103
Parameters
- CmpInst::Predicate Pred
- const llvm::ConstantRange& Other
¶static llvm::ConstantRange makeExactICmpRegion(
CmpInst::Predicate Pred,
const llvm::APInt& Other)
static llvm::ConstantRange makeExactICmpRegion(
CmpInst::Predicate Pred,
const llvm::APInt& Other)
Description
Produce the exact range such that all values in the returned range satisfy the given predicate with any value contained within Other. Formally, this returns the exact answer when the superset of 'union over all y in Other is exactly same as the subset of intersection over all y in Other. { x : icmp op x y is true}'. Example: Pred = ult and Other = i8 3 returns [0, 3)
Declared at: llvm/include/llvm/IR/ConstantRange.h:124
Parameters
- CmpInst::Predicate Pred
- const llvm::APInt& Other
¶static llvm::ConstantRange makeExactNoWrapRegion(
Instruction::BinaryOps BinOp,
const llvm::APInt& Other,
unsigned int NoWrapKind)
static llvm::ConstantRange makeExactNoWrapRegion(
Instruction::BinaryOps BinOp,
const llvm::APInt& Other,
unsigned int NoWrapKind)
Description
Produce the range that contains X if and only if "X BinOp Other" does not wrap.
Declared at: llvm/include/llvm/IR/ConstantRange.h:175
Parameters
- Instruction::BinaryOps BinOp
- const llvm::APInt& Other
- unsigned int NoWrapKind
¶static llvm::ConstantRange
makeGuaranteedNoWrapRegion(
Instruction::BinaryOps BinOp,
const llvm::ConstantRange& Other,
unsigned int NoWrapKind)
static llvm::ConstantRange
makeGuaranteedNoWrapRegion(
Instruction::BinaryOps BinOp,
const llvm::ConstantRange& Other,
unsigned int NoWrapKind)
Description
Produce the largest range containing all X such that "X BinOp Y" is guaranteed not to wrap (overflow) for *all* Y in Other. However, there may be *some* Y in Other for which additional X not contained in the result also do not overflow. NoWrapKind must be one of OBO::NoUnsignedWrap or OBO::NoSignedWrap. Examples: typedef OverflowingBinaryOperator OBO; #define MGNR makeGuaranteedNoWrapRegion MGNR(Add, [i8 1, 2), OBO::NoSignedWrap) == [-128, 127) MGNR(Add, [i8 1, 2), OBO::NoUnsignedWrap) == [0, -1) MGNR(Add, [i8 0, 1), OBO::NoUnsignedWrap) == Full Set MGNR(Add, [i8 -1, 6), OBO::NoSignedWrap) == [INT_MIN+1, INT_MAX-4) MGNR(Sub, [i8 1, 2), OBO::NoSignedWrap) == [-127, 128) MGNR(Sub, [i8 1, 2), OBO::NoUnsignedWrap) == [1, 0)
Declared at: llvm/include/llvm/IR/ConstantRange.h:169
Parameters
- Instruction::BinaryOps BinOp
- const llvm::ConstantRange& Other
- unsigned int NoWrapKind
¶static llvm::ConstantRange
makeSatisfyingICmpRegion(
CmpInst::Predicate Pred,
const llvm::ConstantRange& Other)
static llvm::ConstantRange
makeSatisfyingICmpRegion(
CmpInst::Predicate Pred,
const llvm::ConstantRange& Other)
Description
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)
Declared at: llvm/include/llvm/IR/ConstantRange.h:114
Parameters
- CmpInst::Predicate Pred
- const llvm::ConstantRange& Other
¶llvm::ConstantRange multiply(
const llvm::ConstantRange& Other) const
llvm::ConstantRange multiply(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a multiplication of a value in this range and a value in \p Other, treating both this and \p Other as unsigned ranges.
Declared at: llvm/include/llvm/IR/ConstantRange.h:419
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange overflowingBinaryOp(
Instruction::BinaryOps BinOp,
const llvm::ConstantRange& Other,
unsigned int NoWrapKind) const
llvm::ConstantRange overflowingBinaryOp(
Instruction::BinaryOps BinOp,
const llvm::ConstantRange& Other,
unsigned int NoWrapKind) const
Description
Return a new range representing the possible values resulting from an application of the specified overflowing binary operator to a left hand side of this range and a right hand side of \p Other given the provided knowledge about lack of wrapping \p NoWrapKind.
Declared at: llvm/include/llvm/IR/ConstantRange.h:388
Parameters
- Instruction::BinaryOps BinOp
- const llvm::ConstantRange& Other
- unsigned int NoWrapKind
¶void print(llvm::raw_ostream& OS) const
void print(llvm::raw_ostream& OS) const
Description
Print out the bounds to a stream.
Declared at: llvm/include/llvm/IR/ConstantRange.h:560
Parameters
¶llvm::ConstantRange sadd_sat(
const llvm::ConstantRange& Other) const
llvm::ConstantRange sadd_sat(
const llvm::ConstantRange& Other) const
Description
Perform a signed saturating addition of two constant ranges.
Declared at: llvm/include/llvm/IR/ConstantRange.h:498
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange sdiv(
const llvm::ConstantRange& Other) const
llvm::ConstantRange sdiv(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a signed division of a value in this range and a value in\p Other. Division by zero and division of SignedMin by -1 are considered undefined behavior, in line with IR, and do not contribute towards the result.
Declared at: llvm/include/llvm/IR/ConstantRange.h:452
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange sextOrTrunc(
uint32_t BitWidth) const
llvm::ConstantRange sextOrTrunc(
uint32_t BitWidth) const
Description
Make this range have the bit width given by \p BitWidth. The value is sign extended, truncated, or left alone to make it that width.
Declared at: llvm/include/llvm/IR/ConstantRange.h:376
Parameters
- uint32_t BitWidth
¶llvm::ConstantRange shl(
const llvm::ConstantRange& Other) const
llvm::ConstantRange shl(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a left shift of a value in this range by a value in \p Other. TODO: This isn't fully implemented yet.
Declared at: llvm/include/llvm/IR/ConstantRange.h:484
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange signExtend(
uint32_t BitWidth) const
llvm::ConstantRange signExtend(
uint32_t BitWidth) const
Description
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.
Declared at: llvm/include/llvm/IR/ConstantRange.h:362
Parameters
- uint32_t BitWidth
¶llvm::ConstantRange::OverflowResult
signedAddMayOverflow(
const llvm::ConstantRange& Other) const
llvm::ConstantRange::OverflowResult
signedAddMayOverflow(
const llvm::ConstantRange& Other) const
Description
Return whether signed add of the two ranges always/never overflows.
Declared at: llvm/include/llvm/IR/ConstantRange.h:545
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange::OverflowResult
signedSubMayOverflow(
const llvm::ConstantRange& Other) const
llvm::ConstantRange::OverflowResult
signedSubMayOverflow(
const llvm::ConstantRange& Other) const
Description
Return whether signed sub of the two ranges always/never overflows.
Declared at: llvm/include/llvm/IR/ConstantRange.h:551
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange smax(
const llvm::ConstantRange& Other) const
llvm::ConstantRange smax(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a signed maximum of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:428
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange smin(
const llvm::ConstantRange& Other) const
llvm::ConstantRange smin(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a signed minimum of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:436
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange smul_fast(
const llvm::ConstantRange& Other) const
llvm::ConstantRange smul_fast(
const llvm::ConstantRange& Other) const
Description
Return range of possible values for a signed multiplication of this and\p Other. However, if overflow is possible always return a full range rather than trying to determine a more precise result.
Declared at: llvm/include/llvm/IR/ConstantRange.h:424
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange smul_sat(
const llvm::ConstantRange& Other) const
llvm::ConstantRange smul_sat(
const llvm::ConstantRange& Other) const
Description
Perform a signed saturating multiplication of two constant ranges.
Declared at: llvm/include/llvm/IR/ConstantRange.h:510
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange srem(
const llvm::ConstantRange& Other) const
llvm::ConstantRange srem(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a signed remainder operation of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:462
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange sshl_sat(
const llvm::ConstantRange& Other) const
llvm::ConstantRange sshl_sat(
const llvm::ConstantRange& Other) const
Description
Perform a signed saturating left shift of this constant range by a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:518
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange ssub_sat(
const llvm::ConstantRange& Other) const
llvm::ConstantRange ssub_sat(
const llvm::ConstantRange& Other) const
Description
Perform a signed saturating subtraction of two constant ranges.
Declared at: llvm/include/llvm/IR/ConstantRange.h:504
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange sub(
const llvm::ConstantRange& Other) const
llvm::ConstantRange sub(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a subtraction of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:406
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange subWithNoWrap(
const llvm::ConstantRange& Other,
unsigned int NoWrapKind,
llvm::ConstantRange::PreferredRangeType
RangeType = Smallest) const
llvm::ConstantRange subWithNoWrap(
const llvm::ConstantRange& Other,
unsigned int NoWrapKind,
llvm::ConstantRange::PreferredRangeType
RangeType = Smallest) const
Description
Return a new range representing the possible values resulting from an subtraction with wrap type \p NoWrapKind of a value in this range and a value in \p Other. If the result range is disjoint, the preferred range is determined by the\p PreferredRangeType.
Declared at: llvm/include/llvm/IR/ConstantRange.h:413
Parameters
- const llvm::ConstantRange& Other
- unsigned int NoWrapKind
- llvm::ConstantRange::PreferredRangeType RangeType = Smallest
¶llvm::ConstantRange subtract(
const llvm::APInt& CI) const
llvm::ConstantRange subtract(
const llvm::APInt& CI) const
Description
Subtract the specified constant from the endpoints of this constant range.
Declared at: llvm/include/llvm/IR/ConstantRange.h:304
Parameters
- const llvm::APInt& CI
¶llvm::KnownBits toKnownBits() const
llvm::KnownBits toKnownBits() const
Description
Return known bits for values in this range.
Declared at: llvm/include/llvm/IR/ConstantRange.h:557
¶llvm::ConstantRange truncate(
uint32_t BitWidth) const
llvm::ConstantRange truncate(
uint32_t BitWidth) const
Description
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.
Declared at: llvm/include/llvm/IR/ConstantRange.h:368
Parameters
- uint32_t BitWidth
¶llvm::ConstantRange uadd_sat(
const llvm::ConstantRange& Other) const
llvm::ConstantRange uadd_sat(
const llvm::ConstantRange& Other) const
Description
Perform an unsigned saturating addition of two constant ranges.
Declared at: llvm/include/llvm/IR/ConstantRange.h:495
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange udiv(
const llvm::ConstantRange& Other) const
llvm::ConstantRange udiv(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from an unsigned division of a value in this range and a value in\p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:445
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange umax(
const llvm::ConstantRange& Other) const
llvm::ConstantRange umax(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from an unsigned maximum of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:432
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange umin(
const llvm::ConstantRange& Other) const
llvm::ConstantRange umin(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from an unsigned minimum of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:440
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange umul_sat(
const llvm::ConstantRange& Other) const
llvm::ConstantRange umul_sat(
const llvm::ConstantRange& Other) const
Description
Perform an unsigned saturating multiplication of two constant ranges.
Declared at: llvm/include/llvm/IR/ConstantRange.h:507
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange unionWith(
const llvm::ConstantRange& CR,
llvm::ConstantRange::PreferredRangeType Type =
Smallest) const
llvm::ConstantRange unionWith(
const llvm::ConstantRange& CR,
llvm::ConstantRange::PreferredRangeType Type =
Smallest) const
Description
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.
Declared at: llvm/include/llvm/IR/ConstantRange.h:332
Parameters
- const llvm::ConstantRange& CR
- llvm::ConstantRange::PreferredRangeType Type = Smallest
¶llvm::ConstantRange::OverflowResult
unsignedAddMayOverflow(
const llvm::ConstantRange& Other) const
llvm::ConstantRange::OverflowResult
unsignedAddMayOverflow(
const llvm::ConstantRange& Other) const
Description
Return whether unsigned add of the two ranges always/never overflows.
Declared at: llvm/include/llvm/IR/ConstantRange.h:542
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange::OverflowResult
unsignedMulMayOverflow(
const llvm::ConstantRange& Other) const
llvm::ConstantRange::OverflowResult
unsignedMulMayOverflow(
const llvm::ConstantRange& Other) const
Description
Return whether unsigned mul of the two ranges always/never overflows.
Declared at: llvm/include/llvm/IR/ConstantRange.h:554
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange::OverflowResult
unsignedSubMayOverflow(
const llvm::ConstantRange& Other) const
llvm::ConstantRange::OverflowResult
unsignedSubMayOverflow(
const llvm::ConstantRange& Other) const
Description
Return whether unsigned sub of the two ranges always/never overflows.
Declared at: llvm/include/llvm/IR/ConstantRange.h:548
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange urem(
const llvm::ConstantRange& Other) const
llvm::ConstantRange urem(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from an unsigned remainder operation of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:457
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange ushl_sat(
const llvm::ConstantRange& Other) const
llvm::ConstantRange ushl_sat(
const llvm::ConstantRange& Other) const
Description
Perform an unsigned saturating left shift of this constant range by a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:514
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange usub_sat(
const llvm::ConstantRange& Other) const
llvm::ConstantRange usub_sat(
const llvm::ConstantRange& Other) const
Description
Perform an unsigned saturating subtraction of two constant ranges.
Declared at: llvm/include/llvm/IR/ConstantRange.h:501
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange zeroExtend(
uint32_t BitWidth) const
llvm::ConstantRange zeroExtend(
uint32_t BitWidth) const
Description
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.
Declared at: llvm/include/llvm/IR/ConstantRange.h:356
Parameters
- uint32_t BitWidth
¶llvm::ConstantRange zextOrTrunc(
uint32_t BitWidth) const
llvm::ConstantRange zextOrTrunc(
uint32_t BitWidth) const
Description
Make this range have the bit width given by \p BitWidth. The value is zero extended, truncated, or left alone to make it that width.
Declared at: llvm/include/llvm/IR/ConstantRange.h:372
Parameters
- uint32_t BitWidth