diff options
Diffstat (limited to 'llvm/include/llvm/IR/ConstantRange.h')
-rw-r--r-- | llvm/include/llvm/IR/ConstantRange.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/ConstantRange.h b/llvm/include/llvm/IR/ConstantRange.h index 964f9e8e9bc9..e6bac8a5f933 100644 --- a/llvm/include/llvm/IR/ConstantRange.h +++ b/llvm/include/llvm/IR/ConstantRange.h @@ -327,6 +327,14 @@ public: const ConstantRange &Other) const; /// 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. + ConstantRange overflowingBinaryOp(Instruction::BinaryOps BinOp, + const ConstantRange &Other, + unsigned NoWrapKind) const; + + /// Return a new range representing the possible values resulting /// from an addition of a value in this range and a value in \p Other. ConstantRange add(const ConstantRange &Other) const; @@ -343,6 +351,14 @@ public: ConstantRange sub(const ConstantRange &Other) const; /// 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. + ConstantRange subWithNoWrap(const ConstantRange &Other, unsigned NoWrapKind, + PreferredRangeType RangeType = Smallest) const; + + /// 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. ConstantRange multiply(const ConstantRange &Other) const; @@ -418,6 +434,20 @@ public: /// Perform a signed saturating subtraction of two constant ranges. ConstantRange ssub_sat(const ConstantRange &Other) const; + /// Perform an unsigned saturating multiplication of two constant ranges. + ConstantRange umul_sat(const ConstantRange &Other) const; + + /// Perform a signed saturating multiplication of two constant ranges. + ConstantRange smul_sat(const ConstantRange &Other) const; + + /// Perform an unsigned saturating left shift of this constant range by a + /// value in \p Other. + ConstantRange ushl_sat(const ConstantRange &Other) const; + + /// Perform a signed saturating left shift of this constant range by a + /// value in \p Other. + ConstantRange sshl_sat(const ConstantRange &Other) const; + /// Return a new range that is the logical not of the current set. ConstantRange inverse() const; |