Chapter 13. Register Allocation
The code generated by a compiler must make effective use of the limited resources of the target processor. Among the most constrained resources is the set of hardware registers. Thus, most compilers include a pass that both allocates and assigns hardware registers to program values.
This chapter focuses on global register allocation and assignment via graph coloring; it describes the problems that occur at smaller scopes as a means of motivating a global allocator.
Keywords: Register Allocation, Register Spilling, Copy Coalescing, Graph-Coloring Allocators

13.1. Introduction

Registers are the fastest locations in the memory hierarchy. Often, they are the only memory locations that most operations can access directly. ...

Get Engineering a Compiler, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.