llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

riscv popcount lowering shouldn't call __muldi3/__mulsi3

Open efriedma-quic opened this issue 11 months ago • 6 comments

Consider:

int a(unsigned x) { return __builtin_popcount(x); }

With -march=rv32i, this generates a call to __mulsi3. This is likely to be slow; if we don't have "m", we should use shifts instead.

efriedma-quic avatar Mar 21 '24 21:03 efriedma-quic