On Wed, 17 Jun 2026, Robin Dapp wrote:

> > The following adds vec_decostruct to replace nunits * vec_to_scalar
> > which allows for more precise costing whenever vectorization
> > needs to decompose a vector to pieces, like for emulated gather/scatter
> > but also for strided [SLP] loads/stores.
> >
> > This requires changes across targets, both for the different kind
> > but also for the difference in expected count.
> >
> > I've done x86 adjustments but refrained from trying to understand
> > the complex aarch64 and riscv cost models (nor arm or ppc).  I'd
> > welcome patches or a simple "OK, we'll fix it" though ;)
> >
> > That is, does this look OK?
> 
> I find the x86 costing more difficult than riscv's but "OK, we'll fix it" :)

Heh ;)

> BTW, only half related and more out of interest but did you plan to "fix" 
> constant permute costs (i.e. always pass the permute indices for costing)?  
> This is on my list for this stage 1 but not at the top.
> My early draft included storing the permute constants on the side (like a 
> hash 
> table) to be able to access them later when needed.  All I remember was that 
> it 
> got ugly quickly, but I haven't come back to it in a while.

Yes, that's one thing I'd like to fix, Hongtao already put in some
code that looks at SLP_TREE_LOAD_PERMUTATION, but for permuted
VMAT_STRIDED_SLP I'd like to record the actual load/permute pairs
we compute at costing time since that would be much easier to deal
with.  There's also SLP permute nodes themselves, but the structure
there is similar.  I think storing the analysis so we can just
replay it during transform would be useful, but that leaves targets
to interpret that data - maybe that's not too bad.

Richard.

Reply via email to