chromatic wrote:
On Thursday 07 August 2008 08:26:19 Bob Rogers wrote:
I once suggested a "null register allocator" that would do this
globally, but this is a better idea. The only use case I can think of
is debugging, particularly of the register allocator, but that's still
important.
In theory, that's what the vanilla register allocator does. In practice,
somehow something sometimes turns on the graph-based allocator, which has a
couple of bugs. PGE trips this occasionally.
The graph-based allocator is currently completely disabled, and may be
ripped out.
:unique_reg is a useful feature. For one thing, it's a compiler
optimization to skip the allocation code on certain variables. And,
we're likely to run through multiple register allocator algorithms over
the years, so the ability to protect certain variables from register
alligators is likely to find future use.
When disabling optimizations, you generally want to do it for the
smallest area possible, so turning off allocation for particular
variables is better than turning it off for an entire subroutine. But,
if we find that supporting :unique_reg for particular variables makes it
overly difficult to implement future register allocators, we can
deprecate it then and switch to a per-subroutine selector.
Allison