diff options
author | Nikita Popov <npopov@redhat.com> | 2024-06-04 08:31:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-04 08:31:03 +0200 |
commit | deab451e7a7f2dff42097049274637052c87eabd (patch) | |
tree | 5a261b1bbbdcb0e3c7c732eb4a6d1cc187743dbf /llvm/lib/IR/ConstantFold.cpp | |
parent | 46672c1dc3272adda838caa87bf3fb17411986fb (diff) | |
download | llvm-deab451e7a7f2dff42097049274637052c87eabd.zip llvm-deab451e7a7f2dff42097049274637052c87eabd.tar.gz llvm-deab451e7a7f2dff42097049274637052c87eabd.tar.bz2 |
[IR] Remove support for icmp and fcmp constant expressions (#93038)
Remove support for the icmp and fcmp constant expressions.
This is part of:
https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179
As usual, many of the updated tests will no longer test what they were
originally intended to -- this is hard to preserve when constant
expressions get removed, and in many cases just impossible as the
existence of a specific kind of constant expression was the cause of the
issue in the first place.
Diffstat (limited to 'llvm/lib/IR/ConstantFold.cpp')
-rw-r--r-- | llvm/lib/IR/ConstantFold.cpp | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp index 0ef92ea..7b8b9a7 100644 --- a/llvm/lib/IR/ConstantFold.cpp +++ b/llvm/lib/IR/ConstantFold.cpp @@ -863,22 +863,6 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode, Constant *C1, if (CI2->isMinusOne()) return C2; // X | -1 == -1 break; - case Instruction::Xor: - if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { - switch (CE1->getOpcode()) { - default: - break; - case Instruction::ICmp: - case Instruction::FCmp: - // cmp pred ^ true -> cmp !pred - assert(CI2->isOne()); - CmpInst::Predicate pred = (CmpInst::Predicate)CE1->getPredicate(); - pred = CmpInst::getInversePredicate(pred); - return ConstantExpr::getCompare(pred, CE1->getOperand(0), - CE1->getOperand(1)); - } - } - break; } } else if (isa<ConstantInt>(C1)) { // If C1 is a ConstantInt and C2 is not, swap the operands. |