[llvm] [RISCV] Strength reduce mul by 2^N - 2^M (PR #88983)

Brandon Wu via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 17 07:17:52 PDT 2024


================
@@ -13474,6 +13476,19 @@ static SDValue expandMul(SDNode *N, SelectionDAG &DAG,
     }
   }
 
+  // 2^N - 2^M -> (sub (shl X, C1), (shl X, C2))
----------------
4vtomat wrote:

I think we missed the rule in RISCV's `TLI.decomposeMulByConstant`?

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


More information about the llvm-commits mailing list