This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Hookize CLASS_LIKELY_SPILLED_P


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]