[llvm] c82cc62 - Revert "[IR] Mark mul and ashr const exprs as undesirable"

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 02:16:30 PST 2023


Author: Nikita Popov
Date: 2023-11-07T11:16:10+01:00
New Revision: c82cc62387c84877ef2a08f12e9be89ef1c33000

URL: https://github.com/llvm/llvm-project/commit/c82cc62387c84877ef2a08f12e9be89ef1c33000
DIFF: https://github.com/llvm/llvm-project/commit/c82cc62387c84877ef2a08f12e9be89ef1c33000.diff

LOG: Revert "[IR] Mark mul and ashr const exprs as undesirable"

This reverts commit 0a362f12ec60a49a054befec8620a8e69523af54.

This causes test failures in flang.

Added: 
    

Modified: 
    llvm/lib/IR/Constants.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index 0005b2f2dc54389..4e480691558f043 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::Mul:
-  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:


        


More information about the llvm-commits mailing list