11.6 Register Allocation
To prepare for code generation, the compiler decides where values of variables and expressions will reside during execution. The preferred location is a register since instructions execute faster when the data referred to in operands reside in registers. Ultimate storage is often a memory location, and due to the scarcity of registers, even intermediate results may need to be assigned memory locations also.
Memory allocation techniques are discussed in Module 12; in this chapter, we will address the issue of register allocation.
11.6.1 Register Allocation vs.Assignment
11.6.2 Register Allocation Schemes
11.6.3 Register Allocation by Usage Counts
11.6.4 Register Allocation by Graph Coloring
11.6.5 Register Assignment and Reassignment
11.6.4 Register Management