aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Constants.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-07-20 14:31:18 +0200
committerNikita Popov <npopov@redhat.com>2023-07-25 15:31:45 +0200
commit0cab8d20417c0e2ccc1ffc5505e080126f5de8e6 (patch)
treebd55d0f97b01b47316f81b047b756f76fa0aaed4 /llvm/lib/IR/Constants.cpp
parent92c06114b2ea9900a3364fb395988dfb065758f7 (diff)
downloadllvm-0cab8d20417c0e2ccc1ffc5505e080126f5de8e6.zip
llvm-0cab8d20417c0e2ccc1ffc5505e080126f5de8e6.tar.gz
llvm-0cab8d20417c0e2ccc1ffc5505e080126f5de8e6.tar.bz2
Reapply [IR] Mark and/or constant expressions as undesirable
This reapplies the change for and, but also marks or as undesirable at the same time. Only handling one of them can cause infinite combine loops due to the asymmetric handling. ----- In preparation for removing support for and/or expressions, mark them as undesirable. As such, we will no longer implicitly create such expressions, but they still exist.
Diffstat (limited to 'llvm/lib/IR/Constants.cpp')
-rw-r--r--llvm/lib/IR/Constants.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index c69c7c0..8ea799f 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -2288,6 +2288,8 @@ bool ConstantExpr::isDesirableBinOp(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:
@@ -2295,8 +2297,6 @@ bool ConstantExpr::isDesirableBinOp(unsigned Opcode) {
case Instruction::Shl:
case Instruction::LShr:
case Instruction::AShr:
- case Instruction::And:
- case Instruction::Or:
case Instruction::Xor:
return true;
default: