[llvm] [RISCV][TTI] Reduce cost of a build_vector pattern (PR #108419)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 20 08:58:52 PDT 2024


preames wrote:

> > We're doing a packed e16 build vector which is then converted to a mask vector.
> 
> Not quite. I found the surrounding code, and I'm pretty sure what we originally had was a build vector of variable i1, which was _lowered to_ an i16 build vector and a comparison against zero. Which is quite odd, as this patch shouldn't be impacting the costing of a build_vector.

Just noting that I also see a large number of instances of this pattern in leela *without* this patch.  Looking at them, I'm less sure if this is lowering, or a straight forward vectorization of the original code.  It does look like something we could improve both from the perspective of the i1 vector creation, and that most of the masks are indexed loads (which aren't being vectorized at all).  

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


More information about the llvm-commits mailing list