================ @@ -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