Dan Sugalski <[EMAIL PROTECTED]> wrote:
It's possible to get the register allocator in what is essentially an infinite loop, where it runs forever or until it blows memory and dies. It needs to have a means to check for too many iterations and fall back to a slow-but-working version with too much spilling.
Ok. After some (useless) spill iterations, the strategy could be to just spill everything in one run and be done with it. But this is a bit suboptimal.
True, but less sub-optimal than running until you hit an out-of-memory condition or give up with a double spill error. :)
A better strategy would be to discard the life range of lexicals and globals and emit only a fetch for these variables. But that needs some HLL (or programmer) support for denoting lexicals and globals, e.g.
.lexical "foo" .global pmc bar # current syntax but unimplemented
I can see that helping in some circumstances (though not mine) but the code that the register allocator's having fits with has no .local declarations at all. It's all $x register usage from beginning to end.
--
Dan
--------------------------------------"it's like this"------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk