This is the mail archive of the 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]

patch for PR55432 -- optional reloads implementation

  The following patch fixes PR55342:

  To solve the problem, new transformations called *optional reloads*
and undoing them have been implemented.

  Here is an example of what the patch does

                       Before               After
 inout pseudo      inout stack_slot     hr <- stack_slot -- optional reload
 ...           =>  ...                  inout hr
                   hr <- stack slot     ...
 use pseudo        use hr               use hr

Instead of 3 memory access, now we have 1 memory insn.

If hr is not inherited, we undo the optional reload and we have the
same code as before (which have less and shorter insns).

The patch was successfully tested and bootstrapped on x86/x86-64.

Committed as rev. 200723.

2013-07-05  Vladimir Makarov  <>

        PR rtl-optimization/55342
        * lra-int.h (lra_subreg_reload_pseudos): New.
        * lra.c: Add undoing optional reloads to the block diagram.
        (lra_subreg_reload_pseudos): New.
        (lra_optional_reload_pseudos): Change comments.
        (lra): Init and clear lra_subreg_reload_pseudos.  Clear
        lra_optional_reload_pseudos after undo transformations.
        * lra-assigns.c (pseudo_prefix_title): New.
        (lra_setup_reg_renumber): Use it.
        (spill_for): Ditto.  Check subreg reload pseudos too.
        (assign_by_spills): Consider subreg reload pseudos too.
        * lra-constraints.c (simplify_operand_subreg): Use
        lra_subreg_reload_pseudos instead of lra_optional_reload_pseudos.
        (curr_insn_transform): Recognize and do optional reloads.
        (undo_optional_reloads): New.
        (lra_undo_inheritance): Call undo_optional_reloads.

2013-07-05  Vladimir Makarov  <>

        PR rtl-optimization/55342
        * New.

Attachment: opt_reloads.patch
Description: Text document

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