From c5dd1bbcc37e8811e7c6050159014d084eac6438 Mon Sep 17 00:00:00 2001 From: Shoaib Meenai Date: Fri, 10 Nov 2023 17:26:14 -0800 Subject: 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. --- llvm/lib/IR/Constants.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/IR/Constants.cpp') 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: -- cgit v1.1