Efficient global register allocation

11/11/2020
by   Ian Rogers, et al.
0

In a compiler, an essential component is the register allocator. Two main algorithms have dominated implementations, graph coloring and linear scan, differing in how live values are modeled. Graph coloring uses an edge in an `interference graph' to show that two values cannot reside in the same register. Linear scan numbers all values, creates intervals between definition and uses, and then intervals that do not overlap may be allocated to the same register. For both algorithms the liveness models are computed at considerable runtime and memory cost. Furthermore, these algorithms do little to improve code quality, where the target architecture and register coalescing are important concerns. We describe a new register allocation algorithm with lightweight implementation characteristics. The algorithm introduces a `future-active' set for values that will reside in a register later in the allocation. Registers are allocated and freed in the manner of linear scan, although other ordering heuristics could improve code quality or lower runtime cost. An advantageous property of the approach is an ability to make these trade-offs. A key result is the `future-active' set can remove any liveness model for over 90 instructions and 80 algorithm that, for example, solves an inability of the similarly motivated Treescan register allocator to look ahead of the instruction being allocated - allowing an unconstrained allocation order, and an ability to better handle fixed registers and loop carried values. The approach also is not reliant on properties of SSA form, similar to the original linear scan work. An analysis is presented in a production compiler for Java code compiled through SSA form to Android dex files.

READ FULL TEXT

page 9

page 10

research
12/08/2019

Deep Learning-based Hybrid Graph-Coloring Algorithm for Register Allocation

Register allocation, which is a crucial phase of a good optimizing compi...
research
08/06/2023

Binary Code Similarity Detection

Binary code similarity detection is to detect the similarity of code at ...
research
06/28/2019

Pinpointing Performance Inefficiencies in Java

Many performance inefficiencies such as inappropriate choice of algorith...
research
08/26/2020

High-Performance Parallel Graph Coloring with Strong Guarantees on Work, Depth, and Quality

We develop the first parallel graph coloring heuristics with strong theo...
research
04/06/2018

Combinatorial Register Allocation and Instruction Scheduling

This paper introduces a combinatorial optimization approach to register ...
research
03/03/2014

Design and Performance Evaluation of an Optimized Disk Scheduling Algorithm (ODSA)

Management of disk scheduling is a very important aspect of operating sy...
research
11/21/2020

lospre in linear time

Lifetime-optimal speculative partial redundancy elimination (lospre) is ...

Please sign up or login with your details

Forgot password? Click here to reset