Traditional register allocation requires building an interference graph for the entire function or maintaining and updating conflict data incrementally as live ranges are assigned to physical registers. As such, these approaches introduce significant overhead and are unsuitable for JIT compilation.
We propose an SSA-based region-based allocator for JIT compilation. Our allocator breaks a program into single-entry single-exit regions, constructs a small interference graph per region, and assigns colors for each region, guided by SEO ordering. Compared to GCC 10’s allocator, a region-based allocator guided by register pressure, and Clang 10’s allocator, a global priority-based range allocator, our allocator is 5x and 1.75x faster, while maintaining comparable runtime performance (between 0.9x and 1.05x faster).