aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ConstantFolding.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/Analysis/ConstantFolding.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/Analysis/ConstantFolding.cpp')
-rw-r--r--llvm/lib/Analysis/ConstantFolding.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index 3926776..9336361 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -795,11 +795,11 @@ Constant *SymbolicallyEvaluateBinop(unsigned Opc, Constant *Op0, Constant *Op1,
if (Opc == Instruction::And) {
KnownBits Known0 = computeKnownBits(Op0, DL);
KnownBits Known1 = computeKnownBits(Op1, DL);
- if ((Known1.One | Known0.Zero).isAllOnesValue()) {
+ if ((Known1.One | Known0.Zero).isAllOnes()) {
// All the bits of Op0 that the 'and' could be masking are already zero.
return Op0;
}
- if ((Known0.One | Known1.Zero).isAllOnesValue()) {
+ if ((Known0.One | Known1.Zero).isAllOnes()) {
// All the bits of Op1 that the 'and' could be masking are already zero.
return Op1;
}
@@ -2651,7 +2651,7 @@ static Constant *ConstantFoldScalarCall2(StringRef Name,
assert(C1 && "Must be constant int");
// cttz(0, 1) and ctlz(0, 1) are undef.
- if (C1->isOneValue() && (!C0 || C0->isNullValue()))
+ if (C1->isOne() && (!C0 || C0->isZero()))
return UndefValue::get(Ty);
if (!C0)
return Constant::getNullValue(Ty);
@@ -2663,11 +2663,11 @@ static Constant *ConstantFoldScalarCall2(StringRef Name,
case Intrinsic::abs:
// Undef or minimum val operand with poison min --> undef
assert(C1 && "Must be constant int");
- if (C1->isOneValue() && (!C0 || C0->isMinSignedValue()))
+ if (C1->isOne() && (!C0 || C0->isMinSignedValue()))
return UndefValue::get(Ty);
// Undef operand with no poison min --> 0 (sign bit must be clear)
- if (C1->isNullValue() && !C0)
+ if (C1->isZero() && !C0)
return Constant::getNullValue(Ty);
return ConstantInt::get(Ty, C0->abs());