Lung Li, Calling-convention-aware register allocation

Slides

Register allocation is a classic compiler optimization that will significantly speed up programs. It has been studied for decades; researchers continue to find small improvements.

Despite all the studies, we have discovered an issue in register allocation that has been almost completely overlooked. Code for saving and restoring values in registers are added as part of the implementation of the procedure calling convention. However, a typical register allocator views function calls as if they were NOP's and the effects of the calling convention are ignored.

It this talk, we'll explain why calling convention code is important to register allocation and how we can exploit the code inserted for the calling convention to achieve better register allocation.