[llvm] [RISCV] Implement RISCV TTI::getNumberOfParts() (PR #223096)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 20:25:43 PDT 2026


https://github.com/lukel97 commented:

> However, for RISCV we generally don't split vectors. Instead, the normal lowering is to increase the LMUL. However, this doesn't quite match up with how getNumberOfParts is used. Some use cases in SLP are:
> 
> - determine how many architectural registers a wide vector will use to avoid creating vectors that would fill the entire register file
> - decide whether compressing duplicate values in a vector would allow to compress into fewer registers

Should SLP be using `getRegUsageForType` in those cases? It's the same interface but it specifically returns the number of registers, not how many times it's split. So it will return the correct result (number of M1 vector registers) for RVV.

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


More information about the llvm-commits mailing list