aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Constants.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-11-07 10:37:37 +0100
committerNikita Popov <npopov@redhat.com>2023-11-07 10:42:14 +0100
commit0a362f12ec60a49a054befec8620a8e69523af54 (patch)
tree775b1f4d2cb3458fafda6d2926999c1f5a7d8f86 /llvm/lib/IR/Constants.cpp
parent2c4f938f1c01794d9b944c24e9067eac6763e95c (diff)
downloadllvm-0a362f12ec60a49a054befec8620a8e69523af54.zip
llvm-0a362f12ec60a49a054befec8620a8e69523af54.tar.gz
llvm-0a362f12ec60a49a054befec8620a8e69523af54.tar.bz2
[IR] Mark mul and ashr const exprs as undesirable
These will no longer be created by default, but can still be created explicitly.
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 4e48069..0005b2f 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -2133,13 +2133,13 @@ bool ConstantExpr::isDesirableBinOp(unsigned Opcode) {
case Instruction::FRem:
case Instruction::And:
case Instruction::Or:
+ case Instruction::Mul:
+ case Instruction::AShr:
return false;
case Instruction::Add:
case Instruction::Sub:
- case Instruction::Mul:
case Instruction::Shl:
case Instruction::LShr:
- case Instruction::AShr:
case Instruction::Xor:
return true;
default: