[clang-tools-extra] [llvm] [RISCV][Zba] Optimize mul with SH*ADD (PR #68144)

Alexandr Lekomtsev via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 24 10:05:42 PST 2023


================
@@ -983,6 +983,1299 @@ define i64 @mul81(i64 %a) {
   ret i64 %c
 }
 
+
+define i64 @mul153(i64 %a) {
+; RV64I-LABEL: mul153:
----------------
vacmannnn wrote:

Thanks for your feedback,
tests show that 3 shXadds is _a little_ slower than mul, but for some reason GCC uses 3 shXadds - https://godbolt.org/z/oez5Pddde
And even 4 - https://godbolt.org/z/czK3Kd7bs
I'll try to find out why they do this and write later.

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


More information about the cfe-commits mailing list