Profile assisted register allocation
William C. Kreahling, Cindy Norris · 2000
Register allocation is a phase of the compiler in which physical registers are assigned variables to reduce accesses into memory.When there are not enough physical registers for all the variables, then one or more of the variables must be spilled to memory.Spilling consists of storing the variable to memory after the variable has been defined, and loading the variable from memory before using it.Current register allocation techniques, no matter how efficient, will have to insert spill code into the program due to the lack of registers.To decide the best candidate for spilling, the register allocator computes the spill cost for each variable.These spill costs are based on estimates of the overhead that would be added to the program by spilling the variable.This research investigates using profiling information to formulate the spill costs used by the register allocation phase.Profiling is a technique which collects information about the run-time behavior of a program.Our profile assisted register allocator uses the profiling information to calculate accurate spill costs.The experimental study indicates that profile assisted allocation can result in code which executes faster than code allocated using standard spill cost estimates.