On Thu, Aug 7, 2008 at 12:45 PM, Will Coleda <[EMAIL PROTECTED]> wrote:

> On Wed, Aug 6, 2008 at 3:30 PM, Jonathan Worthington <[EMAIL PROTECTED]>
> wrote:
> > Will Coleda wrote:
> >>
> >> Can you describe a situation where this occurs that isn't a bug in the
> >> register allocator?
> >>
> >
> > Yes. IIRC, it was added when I was working on the .Net bytecode
> translator,
> > and it needed to take references to registers in callers.
>
> Being allowed to poke inside your caller's register set seems... evil?
>

if the HLL compiler can make such an analysis (of liveliness), then it can
emit such hints to the register allocator. So it's not that evil imho.

then again, one might argue that the register allocator itself should be
smart enough to see that a certain object is being retrieved into a register
several times in the same block, and decide to optimize that by assigning a
register to it for the whole block.

kjs


>
> Can you provide a working PIR example that shows this functionality?
>
> > If you're doing
> > that, you need to know that the register won't get re-used once the
> > reference has been taken, or you'll end up with a reference to the wrong
> > register. Named registers holding things that references were being taken
> > to, were marked with :unique_reg, to make sure this didn't happen.
> >
> > It also, as Pm mentioned, works as a hint to the register allocator not
> to
> > bother trying to allocate something that will have life over the entire
> > compilation unit anyway.
> >
> > Jonathan
> >
> >
>
>
>
> --
> Will "Coke" Coleda
>

Reply via email to