diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2009-07-11 06:15:39 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2009-07-11 06:15:39 +0000 |
commit | bf8c7f0adf90c8271c790be9922a2f97d19d4c01 (patch) | |
tree | b84d8f3e90e0792979e903143e8d348386694c98 /include/llvm/Support/ConstantRange.h | |
parent | 8955e93b1ffa7645beea0b51e4b091b96063f613 (diff) | |
download | llvm-bf8c7f0adf90c8271c790be9922a2f97d19d4c01.tar.gz llvm-bf8c7f0adf90c8271c790be9922a2f97d19d4c01.tar.bz2 llvm-bf8c7f0adf90c8271c790be9922a2f97d19d4c01.tar.xz |
Move a method that creates constant ranges relative to another constant range
per icmp predicate out of predsimplify and into ConstantRange.
Add another utility method that determines whether one range is a subset of
another. Combine with the former to determine whether icmp pred range, range
is known to be true or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75357 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/ConstantRange.h')
-rw-r--r-- | include/llvm/Support/ConstantRange.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/Support/ConstantRange.h b/include/llvm/Support/ConstantRange.h index fa4235b0cb..27585491b3 100644 --- a/include/llvm/Support/ConstantRange.h +++ b/include/llvm/Support/ConstantRange.h @@ -58,6 +58,12 @@ public: /// assert out if the two APInt's are not the same bit width. ConstantRange(const APInt& Lower, const APInt& Upper); + /// makeICmpRegion - Return the range of values that a value must be within + /// in order for the comparison specified by the predicate against range + /// Other to be true. + static ConstantRange makeICmpRegion(unsigned Pred, + const ConstantRange &Other); + /// getLower - Return the lower value for this range... /// const APInt &getLower() const { return Lower; } @@ -88,6 +94,10 @@ public: /// bool contains(const APInt &Val) const; + /// contains - Return true if the other range is a subset of this one. + /// + bool contains(const ConstantRange &CR) const; + /// getSingleElement - If this set contains a single element, return it, /// otherwise return null. /// |