aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Constants.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2024-06-19 09:10:28 +0200
committerGitHub <noreply@github.com>2024-06-19 09:10:28 +0200
commit6c01011db089bae22630922e1ac30e5d49de3137 (patch)
treed5055b39ebc1fc308353623b6e4e50dee34e2e07 /llvm/lib/IR/Constants.cpp
parentcb20d4d2054e72a2564572a74f34ca01cb791cbf (diff)
downloadllvm-6c01011db089bae22630922e1ac30e5d49de3137.zip
llvm-6c01011db089bae22630922e1ac30e5d49de3137.tar.gz
llvm-6c01011db089bae22630922e1ac30e5d49de3137.tar.bz2
[IR] Mark shl constant expression as undesirable (#95940)
Mark shl constant expressions undesirable, so that they are no longer automatically created by IRBuilder, constant folding, etc. This is in preparation for removing them entirely.
Diffstat (limited to 'llvm/lib/IR/Constants.cpp')
-rw-r--r--llvm/lib/IR/Constants.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index d079073..fed3670 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -2324,11 +2324,11 @@ bool ConstantExpr::isDesirableBinOp(unsigned Opcode) {
case Instruction::Or:
case Instruction::LShr:
case Instruction::AShr:
+ case Instruction::Shl:
return false;
case Instruction::Add:
case Instruction::Sub:
case Instruction::Mul:
- case Instruction::Shl:
case Instruction::Xor:
return true;
default: