https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116402

            Bug ID: 116402
           Summary: [LRA] Improve hook documentation for reload -> LRA
                    transition
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gjl at gcc dot gnu.org
  Target Milestone: ---

Trying to switch the avr backend to LRA, I came across a bunch of questions
which may pop up as other backend maintainers are trying to convert their
backends to LRA, too.

TARGET_CANNOT_SUBSTITUTE_MEM_EQUIV_P explains the function of the hook from the
perspective of someone who is implementing a register allocator, but there is
no explanation whether it is a good idea (or even required) to implement it for
some specific target.  What form can "subst" take?  When the hook's purpose it
to avoid spills, then why not return always true? (Nobody wants spills when
they can be avoided).

TARGET_LEGITIMIZE_ADDRESS_DISPLACEMENT: How would I describe addressing
capabilities for different named address-spaces?  Or will it only be used for
geeric address space? Stack slots? What kind of target code can I use to
investigate the effect of the hook? Or can it be inferred simply from the
device's register layout?

TARGET_SPILL_CLASS:  Can't we just return GENERAL_REGS as a spill class?

TARGET_COMPUTE_PRESSURE_CLASSES:  Again the documentation is from the
perspective of someone who is writing a register allocator, but not helpful for
someone who has to provide an implementation.

TARGET_ADDITIONAL_ALLOCNO_CLASS_P: Similar issue.

TARGET_REGISTER_PRIORITY: When some registers are preferred over others and
hence we give them a higher priority, might that lead to more MOVs or spills? 
What's the relation to reg_alloc_order[] ?

What about reload_completed?  Does semantics stay the same? What about
reg_renumber[].  And reload_in_progress becomes lra_in_progress?

TARGET_IRA_CHANGE_PSEUDO_ALLOCNO_CLASS: The purpose / documentation of the hook
is clear for regalloc guys, but when and why and how would I do it for a
specific backend?  The hook has two "reg_class_t" parameters as inputs, and
none of the parameters does even have a name. "default hook always returns
given class" ... Which one? There are two indestinguishible ones.

What hooks / global variables are not used by LRA? LEGITIMIZE_RELOAD_ADDRESS is
one example, but presumably there are many more.

Reply via email to