Bill Coffman <[EMAIL PROTECTED]> wrote: > I am currently working on a fix to the large subroutine register > allocation bug, aka, "massive spilling not yet implemented". The > problem, is that the register allocation code is complex, and I'm not > all that familiar with it, or even with working with compilers at the > coding level.
If you encounter any problems, please just ask. > I am comming at the problem as a former graph theorist, That's good. > ... The first attached program (gen3.pl), Some remargs WRT gen{3,4}.pl: 1) While these programs exhibit some worst case register layout it's probably not a very typical layout. 2) RL programs have lexicals and globals access spread over the code like in the generated gen.imc 3) and that's intersparsed with highly local access to temporaries coming from expression evaluations. I'd change the simulation program to use PMCs to allow for 2). Now when it comes to spilling, these lexicals or globals don't need a new storage, their live range can just get discarded and at the next usage of this lexical or global it just can be refetched[1]. Implementing this should already vastly improve the register allocation. [1] The refetching can of course be into a different Parrot register. Thus the usage of globals or lexicals wouldn't interfer and generate huge live ranges over the whole function as it currently does. I don't know if we need some syntax to easily support lexicals or globals or if the register allocation can deduce that itself. But if a new syntax simplifies that, we put it in. For 3) there is already a separate pass in imcc/reg_alloc.c:allocate_non_interfering(). leo