aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Constants.cpp
diff options
context:
space:
mode:
authorShoaib Meenai <smeenai@fb.com>2023-11-10 17:26:14 -0800
committerShoaib Meenai <smeenai@fb.com>2023-11-10 17:26:14 -0800
commitc5dd1bbcc37e8811e7c6050159014d084eac6438 (patch)
tree159bed59e7fb6afad83af7add4c08b692f95c70b /llvm/lib/IR/Constants.cpp
parent55ac33235db3635a797f98f4539d665bfacf92df (diff)
downloadllvm-c5dd1bbcc37e8811e7c6050159014d084eac6438.zip
llvm-c5dd1bbcc37e8811e7c6050159014d084eac6438.tar.gz
llvm-c5dd1bbcc37e8811e7c6050159014d084eac6438.tar.bz2
Revert "Revert "[IR] Mark lshr and ashr constant expressions as undesirable""
This reverts commit 8ee07a4be7f7d8654ecf25e7ce0a680975649544. The revert is breaking AMDGPU backend tests (which I didn't have enabled), and I don't want to risk breakages over the weekend, so just revert for now.
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..aab624b 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::LShr:
+ 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: