diff options
author | Nikita Popov <npopov@redhat.com> | 2023-07-20 15:19:54 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2023-08-22 09:29:54 +0200 |
commit | 625113402f9febd4d8c907a342ea09a3c0982ba8 (patch) | |
tree | a5c12db84fb476b23396a6f9909c437c104fcf18 /llvm/lib/IR/Constants.cpp | |
parent | 1c6e6432ca0b6832e06b93a4bcf22ead1899c14d (diff) | |
download | llvm-625113402f9febd4d8c907a342ea09a3c0982ba8.zip llvm-625113402f9febd4d8c907a342ea09a3c0982ba8.tar.gz llvm-625113402f9febd4d8c907a342ea09a3c0982ba8.tar.bz2 |
[IR] Remove support for and/or constant expressions
As part of https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179,
this removes support for and and or constant expressions. Places
creating such expressions have been migrated in advance, so this
is mostly API removal and test updates.
Differential Revision: https://reviews.llvm.org/D155924
Diffstat (limited to 'llvm/lib/IR/Constants.cpp')
-rw-r--r-- | llvm/lib/IR/Constants.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp index c9b94ba..6589bd3 100644 --- a/llvm/lib/IR/Constants.cpp +++ b/llvm/lib/IR/Constants.cpp @@ -2315,6 +2315,8 @@ bool ConstantExpr::isSupportedBinOp(unsigned Opcode) { case Instruction::FMul: case Instruction::FDiv: case Instruction::FRem: + case Instruction::And: + case Instruction::Or: return false; case Instruction::Add: case Instruction::Sub: @@ -2322,8 +2324,6 @@ bool ConstantExpr::isSupportedBinOp(unsigned Opcode) { case Instruction::Shl: case Instruction::LShr: case Instruction::AShr: - case Instruction::And: - case Instruction::Or: case Instruction::Xor: return true; default: @@ -2584,14 +2584,6 @@ Constant *ConstantExpr::getMul(Constant *C1, Constant *C2, return get(Instruction::Mul, C1, C2, Flags); } -Constant *ConstantExpr::getAnd(Constant *C1, Constant *C2) { - return get(Instruction::And, C1, C2); -} - -Constant *ConstantExpr::getOr(Constant *C1, Constant *C2) { - return get(Instruction::Or, C1, C2); -} - Constant *ConstantExpr::getXor(Constant *C1, Constant *C2) { return get(Instruction::Xor, C1, C2); } |