Register Allocation in Optimizing Compilers
Bruce W. Leverett
Abstract
Bruce W. Leverett
Abstract
The subject of this treatise is code optimization in compilers. I discuss both general strategies of optimizing compiler design and specific techniques for achieving individual optimizations. I am only secondarily interested in introducing new optimizations and algorithms; my goal is to integrate a comprehensive set of optimizations into a retargetable compiler. I introduce new formalizations of techniques that are, in many cases, already known. A compiler is retargetable if it can easily be adapted to changes in the machine for which it generates code. These include changing to a completely different machine (different instruction set). In the broadest sense they also include changes to the run-time conventions. Historically, it has proven to be difficult to achieve both retargetability and a high degree of code optimization with a single compiler design. I describe the design and implementation of part of a compiler that achieves both of those goals. I focus on a set of techniques somewhat loosely known as register allocation. This is the process of mapping data items in the source program onto storage locations in the target machine. Data items include variables, results of expression evaluations, results of hidden (implicit) computations, and frequently-used constants. Storage locations include accumulators, index registers, base registers, and (not least) memory locations.
OpenAlex reports 29 citations for this work. Citation counts describe recorded attention and do not establish research quality.
A contribution statement is not available in the OpenAlex record.
Method details are not available in the OpenAlex metadata.
Findings are not separately available in the OpenAlex metadata.
Limitations are not available in the OpenAlex metadata.
Application details are not available in the OpenAlex metadata.
The subject of this treatise is code optimization in compilers. I discuss both general strategies of optimizing compiler design and specific techniques for achieving individual optimizations. I am only secondarily interested in introducing new optimizations and algorithms; my goal is to integrate a comprehensive set of optimizations into a retargetable compiler. I introduce new formalizations of techniques that are, in many cases, already known. A compiler is retargetable if it can easily be adapted to changes in the machine for which it generates code. These include changing to a completely different machine (different instruction set). In the broadest sense they also include changes to the run-time conventions. Historically, it has proven to be difficult to achieve both retargetability and a high degree of code optimization with a single compiler design. I describe the design and implementation of part of a compiler that achieves both of those goals. I focus on a set of techniques somewhat loosely known as register allocation. This is the process of mapping data items in the source program onto storage locations in the target machine. Data items include variables, results of expression evaluations, results of hidden (implicit) computations, and frequently-used constants. Storage locations include accumulators, index registers, base registers, and (not least) memory locations.
Key concepts: Compiler, Register allocation, Computer science, Interprocedural optimization, Programming language, Optimizing compiler, Parallel computing, Set (abstract data type)