[llvm] [RISCV] Strength reduce mul by 2^n + 2/4/8 + 1 (PR #88911)
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 16 10:00:39 PDT 2024
================
@@ -13431,6 +13431,34 @@ static SDValue expandMul(SDNode *N, SelectionDAG &DAG,
return DAG.getNode(ISD::ADD, DL, VT, Shift1, Shift2);
}
}
+
+ // (2^(1,2,3) * 3,5,9 + 1 -> (shXadd (shYadd x, x), x)
+ // Matched in tablegen, avoid perturbing patterns.
+ switch (MulAmt) {
+ case 11: case 13: case 19: case 21: case 25: case 27: case 29:
----------------
preames wrote:
This is not clang-format's preferred format, I'd hand formatted. I'm going to push the clang-format as this isn't worth the time to bother debating.
https://github.com/llvm/llvm-project/pull/88911
More information about the llvm-commits
mailing list