aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/ConstantRange.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2021-09-30 09:54:57 +0100
committerJay Foad <jay.foad@amd.com>2021-10-04 08:57:44 +0100
commita9bceb2b059dc24870882a71baece895fe430107 (patch)
treedf54e088f349b1acf32e20d3819ee000ec0a0677 /llvm/lib/IR/ConstantRange.cpp
parent0873b9bef4e03b4cfc44a4946c11103c763055df (diff)
downloadllvm-a9bceb2b059dc24870882a71baece895fe430107.zip
llvm-a9bceb2b059dc24870882a71baece895fe430107.tar.gz
llvm-a9bceb2b059dc24870882a71baece895fe430107.tar.bz2
[APInt] Stop using soft-deprecated constructors and methods in llvm. NFC.
Stop using APInt constructors and methods that were soft-deprecated in D109483. This fixes all the uses I found in llvm, except for the APInt unit tests which should still test the deprecated methods. Differential Revision: https://reviews.llvm.org/D110807
Diffstat (limited to 'llvm/lib/IR/ConstantRange.cpp')
-rw-r--r--llvm/lib/IR/ConstantRange.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/IR/ConstantRange.cpp b/llvm/lib/IR/ConstantRange.cpp
index 6f47cd0c..530a378 100644
--- a/llvm/lib/IR/ConstantRange.cpp
+++ b/llvm/lib/IR/ConstantRange.cpp
@@ -204,13 +204,13 @@ static ConstantRange makeExactMulNSWRegion(const APInt &V) {
// Handle special case for 0, -1 and 1. See the last for reason why we
// specialize -1 and 1.
unsigned BitWidth = V.getBitWidth();
- if (V == 0 || V.isOneValue())
+ if (V == 0 || V.isOne())
return ConstantRange::getFull(BitWidth);
APInt MinValue = APInt::getSignedMinValue(BitWidth);
APInt MaxValue = APInt::getSignedMaxValue(BitWidth);
// e.g. Returning [-127, 127], represented as [-127, -128).
- if (V.isAllOnesValue())
+ if (V.isAllOnes())
return ConstantRange(-MaxValue, MinValue);
APInt Lower, Upper;
@@ -1161,9 +1161,9 @@ ConstantRange ConstantRange::sdiv(const ConstantRange &RHS) const {
if (NegL.Lower.isMinSignedValue() && NegR.Upper.isZero()) {
// Remove -1 from the LHS. Skip if it's the only element, as this would
// leave us with an empty set.
- if (!NegR.Lower.isAllOnesValue()) {
+ if (!NegR.Lower.isAllOnes()) {
APInt AdjNegRUpper;
- if (RHS.Lower.isAllOnesValue())
+ if (RHS.Lower.isAllOnes())
// Negative part of [-1, X] without -1 is [SignedMin, X].
AdjNegRUpper = RHS.Upper;
else
@@ -1332,9 +1332,9 @@ ConstantRange ConstantRange::binaryXor(const ConstantRange &Other) const {
return {*getSingleElement() ^ *Other.getSingleElement()};
// Special-case binary complement, since we can give a precise answer.
- if (Other.isSingleElement() && Other.getSingleElement()->isAllOnesValue())
+ if (Other.isSingleElement() && Other.getSingleElement()->isAllOnes())
return binaryNot();
- if (isSingleElement() && getSingleElement()->isAllOnesValue())
+ if (isSingleElement() && getSingleElement()->isAllOnes())
return Other.binaryNot();
// TODO: replace this with something less conservative