> 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" :)

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.

-- 
Regards
 Robin

Reply via email to