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: 0004-Set-pseudos-only-once.patch


On 06/22/10 06:08, Maxim Kuvyrkov wrote:
On 6/21/10 9:55 PM, Jeff Law wrote:
On 06/16/10 09:57, Maxim Kuvyrkov wrote:
IRA and reload has special relationship with pseudos that are set only
once. When such pseudos initialized with constants or instances that
can be considered constant across the function, reload can
rematerialize them instead of spilling or apply other optimizations.

This patch makes sure that we don't unnecessarily set same pseudo more
than once.

OK to apply?
OK. THanks,

Thank you for reviewing this and other patches.


There is similar code in gcse.c:pre_delete():

        /* Create a pseudo-reg to store the result of reaching
           expressions into.  Get the mode for the new pseudo from
           the mode of the original destination pseudo.  */
        if (expr->reaching_reg == NULL)
          expr->reaching_reg = gen_reg_rtx_and_attrs (SET_DEST (set));

        gcse_emit_move_after (expr->reaching_reg, SET_DEST (set), insn);
        delete_insn (insn);
        occr->deleted_p = 1;
        changed = 1;
        gcse_subst_count++;

From quick look at PRE, it seem that creating a new pseudo for PRE is also correct. Do you know off-hand if this indeed is the case?
Creating a new pseudo for PRE would be good; however, it's not immediately clear to me if creating a new pseudo is safe given the way deletion & insertion work for our implementation of PRE.

jeff


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