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]

Re: Reload patch v4



> OK.  I had a feeling the mode wasn't needed anymore.  You should update the
> .texi files since they mention what various modes on an INSN mean.

Ok.

>   > If I remember correctly, it's because some files include reload.h, but
>   > not hard-reg-set.h, and that leads to compilation errors.
> Ah.  Depending on the file(s), it might just be best to go ahead and include
> hard-reg-set.h where we need it.

Ok.

> 
>   > > +   /* Let's try without this, I can't see a reason for doing this.  */
>   > > + #if defined ELIMINABLE_REGS && 0
>   > > +   /* If registers other than the frame pointer are eliminable, mark the
>   > m as
>   > > +      poor choices.  */
>   > > +   for (i = 0; i < NUM_ELIMINABLE_REGS; i++)
>   > > +     SET_HARD_REG_BIT (bad_spill_regs, reg_eliminate[i].from);
>   > > +
>   > > + #endif
>   > > 
>   > > You should reenable this code.  Imagine a machine which uses an arg
>   > > pointer ;-)  You really don't want to spill it if at all possible.
>   > > Similarly if the machine has other eliminable regs.
>   > 
>   > Why not, if it is going to be eliminated?
> But you can not guarantee that any particular elimination will happen.

I know.  But I don't have to.

> In fact, you can't know if a particular elimination is safe until after
> the big while loop later in the function.

But order_regs_for_reload is now called from within the while loop for every
insn that needs reloads, with the current information on eliminable registers.
We can use this information, since if the eliminability of a given register
changes, the whole loop will be re-run, and order_regs_for_reload will use
the changed information during the next pass and no longer try to use an
uneliminable register for spills.

Bernd


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