On Mon, 22 Feb 2021, Uros Bizjak wrote:

> The intention of HONOR_REG_ALLOC_ORDER is to ensure that IRA allocates
> registers in the order given by REG_ALLOC_ORDER.  However in
> ira_better_spill_reload_regno_p, there is still a place where the
> calculation depends on the presence of REG_ALLOC_ORDER, ignoring
> HONOR_REG_ALLOC_ORDER macro altogether.  The patch uses the correct macro
> at this place.
> 
> On the other hand, assign_hard_reg function respects HONOR_REG_ALLOC_ORDER,
> but expects this macro to return 1 to avoid internal cost calculations.
> As the macro is defined to 0 by default, it is expected that targets redefine
> HONOR_REG_ALLOC_ORDER to return nonzero value, even if REG_ALLOC_ORDER
> is defined.  This approach is prone to errors, so the patch defines
> HONOR_REG_ALLOC_ORDER to 1 by default if REG_ALLOC_ORDER is defined.
> 
> 2021-02-22  Uroš Bizjak  <ubiz...@gmail.com>
> 
> gcc/
>     * defaults.h (HONOR_REG_ALLOC_ORDER): If not defined,
>     define to 1 if REG_ALLOC_ORDER is defined.
>     * doc/tm.texi.in (HONOR_REG_ALLOC_ORDER):
>     Describe new default definition.
>     * doc/tm.texi: Regenerate.
>     * ira-color.c (ira_better_spill_reload_regno_p):
>     Use HONOR_REG_ALLOC_ORDER instead of REG_ALLOC_ORDER
>     to determine better spill reload regno.
> 
> Patch was bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.
> 
> OK for gcc-12 when it opens?

OK in case Vlad doesn't have a better suggestion or further comments.

Do you have an idea for how many targets the changed default is an
actual change?

Thanks,
Richard.

> Uros.
> 

-- 
Richard Biener <rguent...@suse.de>
SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)

Reply via email to