> This applies a scalar/vector unit ratio to integer vector body costs,
> which helps the cost model better match the actual hardware throughput.
>
> Take an int64 vadd at VLEN=128 for example: 4 scalar units and 2 vector
> units can both process 4 elements per cycle. Without this ratio, both
> vector and scalar stmts just get a cost of 1, which ends up making
> vectorization look too cheap.
>
> Skip applying this ratio for:
> - reduction stmts
> - gather/scatter stmts
>
> Add scalar_units and vector_units fields to riscv_tune_param.  A zero
> value for either field disables the scaling.
>
> For generic-ooo, use a 4:2 scalar/vector unit ratio.
> Other uarch are left unconfig since I dont know their unit number.
> They can be tuned individually later.
>
> BTW, this is still a rough cost model adjustment,
> we’re trying to make progress one small piece at a time.

LGTM, thanks.

-- 
Regards
 Robin

Reply via email to