Register allocation for optimizing compilers is one of the single most valuable optimizations to perform. Most current allocators utilize a register coloring algorithm. They use many varied heuristics to decide which live ranges to break and where to break them when the number of variables exceeds the number of available registers. Such algorithms tend to average out a variable's use over its live range. This can lead to register decisions which are not sensitive to local code's needs.
A prototype global look-ahead register allocator (GLORIA) has been built which avoids the register coloring paradigm and its averaging. Allocation decisions are made for each instruction based on the distances to the next uses of live variables. Problems arise at join points where inconsistencies in allocating different paths can lead to spill code. Similar inconsistencies arise for loops where register assignments at the head and tail of the loop do not agree. GLORIA deals with such problems by preprocessing such areas and providing hints for the subsequent allocation. This allocator currently works only at the subprogram level and does not perform any interprocedural optimization.
Comparisons between GLORIA and a register coloring allocator in the MIPS Pascal compiler have been made. Preliminary results indicate that look-ahead usually performs better. Memory use is on the order of the size of the program while time use is usually the same order but could increase to the cube of the size in the worst case. The prototype needs to be extended to fully handle general programs and more testing with larger programs is required.
Index Terms
- A global look-ahead register allocator
Recommendations
Optimized interval splitting in a linear scan register allocator
VEE '05: Proceedings of the 1st ACM/USENIX international conference on Virtual execution environmentsWe present an optimized implementation of the linear scan register allocation algorithm for Sun Microsystems' Java HotSpot™ client compiler. Linear scan register allocation is especially suitable for just-in-time compilers because it is faster than the ...
Register file partitioning and recompilation for register file power reduction
Register files in modern embedded processors contribute a substantial budget in the energy consumption due to their large switching capacitance and long working time. For some embedded processors, on average 25% of registers account for 83% of register ...
Fast, frequency-based, integrated register allocation and instruction scheduling
Instruction scheduling and register allocation are two of the most important optimization phases in modern compilers as they have a significant impact on the quality of the generated code. Unfortunately, the objectives of these two optimizations are in ...