This is the mail archive of the gcc@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: extra machine-dependent passes


DJ Delorie <dj@redhat.com> writes:

> > I think you need to describe the issue to the folks on the gcc list
> > before they can properly evaluate this patch.
> 
> OK, here's the background: The port I'm working on has a few registers
> that are similar to the MIPS gp register, but because of a shortage of
> registers, they must be available for general use also.  So, I emit a
> move to a pseudo at the beginning of the function, much like the alpha
> saves it's return address register, to keep track of that value.

This sounds like something that would be useful in other ports than
yours.  Just about every port has a registers like this for doing PIC,
and there are lots of ports with few registers available (for
instance, x86 has both properties).  Can you implement this is a
generic way?

It sounds like this would be best done at about the time of
instantiate_virtual_regs; it's really just passing a hidden argument
to the function.

> The pre-alloc hook is intended to, at some point, try to force a
> preference for these pseudos to simply remain in their hard regs,
> since the chip is designed to work best that way.  GCC does OK without
> it, but not as good as I'd like in some cases.

This sounds like a register allocation problem.  Why doesn't the
allocator put them in their preferred registers automatically?  Does
the new allocator also do this?

-- 
- Geoffrey Keating <geoffk@geoffk.org>


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