diff options
author | Nikita Popov <npopov@redhat.com> | 2023-07-20 14:31:18 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2023-07-31 09:54:24 +0200 |
commit | 063b37e7b40ace03184923213bc9ead6aadee540 (patch) | |
tree | a83dd8c929c2044997c421ccc6509549388dfcde /llvm/lib/IR/Constants.cpp | |
parent | 893d3a61c0574a539f2c15206117e6535846aacb (diff) | |
download | llvm-063b37e7b40ace03184923213bc9ead6aadee540.zip llvm-063b37e7b40ace03184923213bc9ead6aadee540.tar.gz llvm-063b37e7b40ace03184923213bc9ead6aadee540.tar.bz2 |
Reapply [IR] Mark and/or constant expressions as undesirable
Reapply after D156401, which stops PatternMatch from recognizing
binop constant expressions, which should avoid the infinite loops
and assertion failures this patch previously exposed.
-----
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.cpp | 4 |
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: |