This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: New Optimization: Partitioning hot & cold basic blocks
- From: law at redhat dot com
- To: Geoff Keating <geoffk at geoffk dot org>
- Cc: Richard Henderson <rth at redhat dot com>, Caroline Tice <ctice at apple dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 29 Jan 2004 16:46:35 -0700
- Subject: Re: PATCH: New Optimization: Partitioning hot & cold basic blocks
- Reply-to: law at redhat dot com
In message <jmu12eid91.fsf@desire.geoffk.org>, Geoff Keating writes:
>> Although... you can't insert new uses of the GP register as late as
>> bb-reorder. After peep2/flow2 you're pretty much SOL wrt adding new
>> references to symbols. By then we've removed dead loads of the GP
>> that may have been left over from reload.
>
>You can't even allocate a register to be used in indirect_jump at this
>point in the compile. If you can fall back to anything at all, it
>must be jump, not indirect_jump.
Not necessarily.
First, you can look at hard register live information and see if a
suitable register is available. If so, use it.
Second, if no hard register is available, you can peek at the target
and see if there is a register which is set before it is used. If so,
you can use that register to hold the target address.
Finally, if you're doing hot/cold splitting you can reserve a stack slot for
holding a register. You then just need to store a well known register
into your reserved stack slot, load the target address into the register,
jump and restore the stack slot. We use this kind of stuff in pathological
cases on the PA.
jeff