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: Patch to delete scratch allocation in local-alloc


> : The code in reload always works, and allocates exactly the scratch registers
> : which are necessary.  The code in local-alloc only guesses; it can't know
> : which alternative is going to be selected by reload.  Worse, global can't
> : override the choices of local-alloc when they turn out to be wrong, which
> : may lead to suboptimal register allocation.
> 
> The same is true for the entire local register allocation.

No, it is not (see below).

> So why do you single out scratch allocation?

Because when reload allocates a scratch, it does exactly the same thing as
local-alloc: it allocates the scratch for its entire lifetime (one insn).
The same is not true for normal registers, reload can't allocate them to
hard registers for their entire lifetime.

> local-alloc does soe things better and some things worse than reload.
> IMHO the real problem is global / reload can't revise a number of decisions
> that local-alloc does - the most glaring one is, of course, the inability to
> re-allocate locally allocated registers that get spilled.

That inability has been fixed recently.

Bernd


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