[PATCH] D93619: [RISCV] Optimize multiplication with constant

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 21 19:31:35 PST 2020


benshi001 marked 2 inline comments as done.
benshi001 added a comment.

This is the best form I can tune now, the best trade among int128, int64 and int32. It generated optimized code for most of them,

except some cases are left not covered,

1. rv32 with M extension: not sure if is a real win since some HW multiplier has quite low lantency, even to 2 cycles.
2. i128 mul on rv32: the generated code is too large, not sure if it is better than calling __multi3
3. -(1<<m)-(1<<n): more NEGS are generated than other (1<<m)±(1<<n), so it may not be optimal than quick HW multipliers.

Shall we commit current form first? Then I will go on with the hard cases in the future.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93619/new/

https://reviews.llvm.org/D93619



More information about the llvm-commits mailing list