diff options
author | Jay Foad <jay.foad@amd.com> | 2021-09-30 09:54:57 +0100 |
---|---|---|
committer | Jay Foad <jay.foad@amd.com> | 2021-10-04 08:57:44 +0100 |
commit | a9bceb2b059dc24870882a71baece895fe430107 (patch) | |
tree | df54e088f349b1acf32e20d3819ee000ec0a0677 /llvm/lib/IR/ConstantFold.cpp | |
parent | 0873b9bef4e03b4cfc44a4946c11103c763055df (diff) | |
download | llvm-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/ConstantFold.cpp')
-rw-r--r-- | llvm/lib/IR/ConstantFold.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp index 2c0532b..e7357a8 100644 --- a/llvm/lib/IR/ConstantFold.cpp +++ b/llvm/lib/IR/ConstantFold.cpp @@ -1141,7 +1141,7 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode, Constant *C1, return ConstantInt::get(CI1->getContext(), C1V.udiv(C2V)); case Instruction::SDiv: assert(!CI2->isZero() && "Div by zero handled above"); - if (C2V.isAllOnesValue() && C1V.isMinSignedValue()) + if (C2V.isAllOnes() && C1V.isMinSignedValue()) return PoisonValue::get(CI1->getType()); // MIN_INT / -1 -> poison return ConstantInt::get(CI1->getContext(), C1V.sdiv(C2V)); case Instruction::URem: @@ -1149,7 +1149,7 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode, Constant *C1, return ConstantInt::get(CI1->getContext(), C1V.urem(C2V)); case Instruction::SRem: assert(!CI2->isZero() && "Div by zero handled above"); - if (C2V.isAllOnesValue() && C1V.isMinSignedValue()) + if (C2V.isAllOnes() && C1V.isMinSignedValue()) return PoisonValue::get(CI1->getType()); // MIN_INT % -1 -> poison return ConstantInt::get(CI1->getContext(), C1V.srem(C2V)); case Instruction::And: |