aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Constants.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-07-20 18:07:41 +0200
committerNikita Popov <npopov@redhat.com>2023-07-20 18:09:17 +0200
commit9dc391e89c7984394e352ea1cbf948b4bbdcd8a8 (patch)
treeb145b966ad62995ca124c1c7c1f6b0e9d6a3fef5 /llvm/lib/IR/Constants.cpp
parent8ef04488d128853715a55683f0181d6398d23c61 (diff)
downloadllvm-9dc391e89c7984394e352ea1cbf948b4bbdcd8a8.zip
llvm-9dc391e89c7984394e352ea1cbf948b4bbdcd8a8.tar.gz
llvm-9dc391e89c7984394e352ea1cbf948b4bbdcd8a8.tar.bz2
Revert "[IR] Mark add constant expressions as undesirable"
This reverts commit f8a36d8c3e264c4fccf8058e699201a452ea7bb7. I believe this is causing an assertion failure on the sanitizer-x86_64-linux buildbot: clang++: /b/sanitizer-x86_64-linux/build/llvm-project/llvm/include/llvm/Support/Casting.h:578: decltype(auto) llvm::cast(From *) [To = llvm::BinaryOperator, From = llvm::Value]: Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed. #10 0x000055bdd7e82408 canonicalizeLogicFirst(llvm::BinaryOperator&, llvm::IRBuilder<llvm::TargetFolder, llvm::IRBuilderCallbackInserter>&) /b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:2131:5 #11 0x000055bdd7e80183 llvm::InstCombinerImpl::visitAnd(llvm::BinaryOperator&) /b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:2661:20 Likely the code is encountering a constant expression in a case it didn't before.
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 07b02c2..c69c7c0 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -2288,7 +2288,6 @@ bool ConstantExpr::isDesirableBinOp(unsigned Opcode) {
case Instruction::FMul:
case Instruction::FDiv:
case Instruction::FRem:
- case Instruction::And:
return false;
case Instruction::Add:
case Instruction::Sub:
@@ -2296,6 +2295,7 @@ 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;