[llvm] [RISCV] Construct constants via instructions if materialization is costly (PR #86926)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 12:38:10 PDT 2024


efriedma-quic wrote:

For the vector case, I think it ends up cheaper if you always start by bitcasting the operand to an i8 vector, and doing an i8 popcount.  That makes the constants involved significantly cheaper. (The width you use to do the arithmetic doesn't matter for correctness, but doing it in i8 means you need fewer vsetvli, I think).  Then you can bitcast back to the wider type to do the multiply/shift.

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


More information about the llvm-commits mailing list