diff options
author | Nikita Popov <npopov@redhat.com> | 2023-07-20 18:07:41 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2023-07-20 18:09:17 +0200 |
commit | 9dc391e89c7984394e352ea1cbf948b4bbdcd8a8 (patch) | |
tree | b145b966ad62995ca124c1c7c1f6b0e9d6a3fef5 /llvm/lib/IR/Constants.cpp | |
parent | 8ef04488d128853715a55683f0181d6398d23c61 (diff) | |
download | llvm-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.cpp | 2 |
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; |