[llvm] [RISCV] Strength reduce mul by 2^N - 2^M (PR #88983)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 17 00:09:10 PDT 2024
================
@@ -13474,6 +13476,19 @@ static SDValue expandMul(SDNode *N, SelectionDAG &DAG,
}
}
+ // 2^N - 2^M -> (sub (shl X, C1), (shl X, C2))
----------------
dtcxzyw wrote:
Isn't it handled by `DAGCombiner::visitMUL`?
https://github.com/llvm/llvm-project/blob/e11b17a4ed90e74147594012207fc35a60515944/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp#L4325-L4371
I'd like to introduce ISD::SHXADD node and move all logic into DAGCombiner.
https://github.com/llvm/llvm-project/pull/88983
More information about the llvm-commits
mailing list