[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-patches
Subject:    Re: [PATCH] Hookize CLASS_LIKELY_SPILLED_P
From:       Vladimir Makarov <vmakarov () redhat ! com>
Date:       2010-08-31 20:24:25
Message-ID: 4C7D64F9.7080207 () redhat ! com
[Download RAW message or body]

  On 08/30/2010 01:06 PM, Richard Henderson wrote:
> On 08/29/2010 07:21 AM, Anatoly Sokolov wrote:
>>          * target.def (class_likely_spilled_p): New hook.
>>          * doc/tm.texi.in (TARGET_CLASS_LIKELY_SPILLED_P): Document.
>>          * doc/tm.texi: Regenerate.
>>          * targhooks.c (default_class_likely_spilled_p): New function.
>>          * targhooks.h (default_class_likely_spilled_p): Declare.
>>          * regs.h (CLASS_LIKELY_SPILLED_P): Remove.
>>          * combine.c: (cant_combine_insn_p, likely_spilled_retval_p): Use
>>          TARGET_CLASS_LIKELY_SPILLED_P target hook. Use HARD_REGISTER_P macro.
>>          Use fixed_reg_set instead of fixed_regs.
>>          * cse.c (hash_rtx_cb): Use TARGET_CLASS_LIKELY_SPILLED_P target hook.
>>          * calls.c (avoid_likely_spilled_reg): Ditto.
>>          * ira-conflicts.c: (ira_build_conflicts): Ditto.
>>          * ira.c (update_equiv_regs): Ditto.
>>          * mode-switching.c (create_pre_exit): Ditto.
>>          * regmove.c (find_matches): Ditto.
>>          (regclass_compatible_p): Use TARGET_CLASS_LIKELY_SPILLED_P target
>>          hook.
>>          * reload.c (SMALL_REGISTER_CLASS_P): Remove macro.
>>          (small_register_class_p): New inline function.
>>          (push_secondary_reload, find_reusable_reload, find_reloads): Use
>>          small_register_class_p instead of SMALL_REGISTER_CLASS_P.
>>
>>          * config/i386/i386.h (CLASS_LIKELY_SPILLED_P): Remove.
>>          * config/i386/i386.c (ix86_class_likely_spilled_p): New.
>>          (TARGET_CLASS_LIKELY_SPILLED_P): Define.
> Ok.
>
>> +@hook TARGET_CLASS_LIKELY_SPILLED_P
>> +A target hook whose return @code{true} if pseudos that have been assigned
>   hook which returns
>
>> +
>> +The default version of this target hook returns @code{true} if @var{rclass}
>> +has exactly one register and @code{false} otherwise.  On most machines, this
>> +default should be used.  Only use this target hook to some other expression
>> +if pseudos allocated by @file{local-alloc.c} end up in memory because their
>> +hard registers were needed for spill registers.  If this target hook returns
>> +@code{false} for those classes, those pseudos will only be allocated by
>> +@file{global.c}, which knows how to reallocate the pseudo to another
>> +register.  If there would not be another register available for reallocation,
> Hum.  I'm really not sure how to fix these references.
>
> Vlad, do you have a suggestion for when CLASS_LIKELY_SPILLED_P
> should be true in the context of the new register allocator?
>
Hm, an interesting question.  I think that paragraph is very unclear.  
It was also wrong even before IRA since one Bernd's patch in 2000.

For IRA, this macro *mostly* means nothing.   So I'd remove mentioning 
register allocator for the macro description and put something about 
effect of this macro on reload work which I'd rather avoid to 
formulate.  This macro now has effect mostly on reload work.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic