On Tue, Aug 05, 2008 at 10:51:08AM -0700, Klaas-Jan Stol wrote:
> From pdd19:
> 
> The optional C<:unique_reg> modifier will force the register allocator to
> associate the identifier with a unique register for the duration of the
> subroutine.
> 
> 
> This, however, does not document /why/ you would want to do that. Why do we
> have this flag?
> Maybe add an example.

Sometimes the register allocator will re-use a register when it's
important that the register not be reused.  The :unique_reg flag
is supposed to guarantee that whatever register is allocated for
a symbol is used _only_ for that symbol and not re-allocated.

PGE has used :unique_reg to try to "turn off" the register allocator
for the subs it generates, which tended to perform badly both in
terms of speed and in terms of correctly allocating registers.
(All of PGE's generated subs use a small fixed number of registers 
and so the register allocator is a detriment and not a help.)

Pm

Reply via email to