On 8/19/26 9:04 AM, Jovan Dmitrovic wrote:
Currently, ivopt calculates register pressure cost so that the cost of
spilling induction variables is exactly double the cost of spilling
loop invariants, which is not exactly right.
When invariants are spilled, only loading the invariant back to
registers should be taken into account, as we don't need to save them
more than once. This isn't the case for IV candidates which have to
be both loaded and stored for each iteration of the loop.
gcc/ChangeLog:
* tree-ssa-loop-ivopts.cc (ivopts_estimate_reg_pressure):
Change register pressure estimate in order to respect
the impact of spilling induction variables, compared
to spilling loop invariants.
Co-authored-by: Radosav Krunić <[email protected]>
Signed-off-by: Djordje Todorović <[email protected]>
Signed-off-by: Chao-Ying Fu <[email protected]>
Signed-off-by: Jovan Dmitrović <[email protected]>
Signed-off-by: Radosav Krunić <[email protected]>
---
I've pushed this one as well. Thanks.
jeff