This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: extra machine-dependent passes
- To: DJ Delorie <dj at redhat dot com>
- Subject: Re: PATCH: extra machine-dependent passes
- From: Geoff Keating <geoffk at geoffk dot org>
- Date: 15 Jun 2001 15:07:44 -0700
- CC: gcc at gcc dot gnu dot org
- References: <32548.992637245@localhost.localdomain> <200106152108.RAA22241@greed.delorie.com>
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>