So may be the way to go is add a field to the uarch tuning structure indicating the additional cost (if any) of a register file crossing vector op of this nature. Then query that in riscv_rtx_costs or whatever our rtx_cost function is named.

Default that additional cost to zero initially. Then uarch experts can fill in the appropriate value. Yea, such a simplistic approach wouldn't handle cases like ours where you really need nearby context to be sure, but I don't think we want to over-engineer this solution too badly right now.

Yeah, we introduced the regmove_vector_cost struct for that reason and it basically does what you suggest. I asked Pan to re-use that in rtx_cost in the review of his patch. Right now it's 2 by default and not 0, though.

--
Regards
Robin

Reply via email to