Hybrid Register Allocation with Spill Cost and Pattern Guided Optimization
LANGUAGES AND COMPILERS FOR PARALLEL COMPUTING (LCPC 2021)(2022)
Abstract
Modern compilers have relied on various best-effort heuristics to solve the register allocation problem due to its high computation complexity. A "greedy" algorithm that performs a scan of prioritized live intervals for allocation followed by interval splits and spills is one of the widely used register allocation mechanisms with consistent performance and low compile-time overheads. However, its live interval splitting heuristics suffer from making sub-optimal decisions for scenarios hard to predict, and recent effort to remedy the issue is not free from unintended side effects with performance degradation. In this paper, we propose Greedy-SO, a greedy register allocator with a spill cost and pattern guided optimization that systematically addresses inherent sub-optimalities in live-interval splitting. Greedy-SO does this by avoiding splitting codes whose performance are more likely to be impacted by sub-optimal decisions. Greedy-SO identifies functions with such code patterns, precisely models the spill cost for them during the greedy allocation process, then when the spill cost starts to deteriorate, switches to an alternative allocator that does not use interval splitting. Our hybrid register allocator improves the performance of target benchmarks up to 16.1% (7.3% on average) with a low compilation overhead, while not impacting non-target benchmarks at all.
MoreTranslated text
Key words
allocation,spill cost,optimization
AI Read Science
Must-Reading Tree
Example
![](https://originalfileserver.aminer.cn/sys/aminer/pubs/mrt_preview.jpeg)
Generate MRT to find the research sequence of this paper
Chat Paper
Summary is being generated by the instructions you defined