[llvm] [SLP] Allow UDiv X, C <--> LShr X, log2(C) tranformations in BinOpSameOpcodeHelper (PR #181731)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 16 11:40:01 PST 2026


================
@@ -1086,7 +1096,8 @@ class BinOpSameOpcodeHelper {
       Constant *RHS;
       switch (FromOpcode) {
       case Instruction::Shl:
-        if (ToOpcode == Instruction::Mul) {
+      case Instruction::LShr:
+        if (ToOpcode == Instruction::Mul || ToOpcode == Instruction::UDiv) {
----------------
alexey-bataev wrote:

I would separate LSHR/DIV from SHL/MUL just to be sure we're safe

https://github.com/llvm/llvm-project/pull/181731


More information about the llvm-commits mailing list