A Modified Linear Scan Register Allocation Algorithm

Srinivasan Subha · 2009

This paper proposes a global register allocation algorithm that makes decisions on register allocation based on the cost of spilling variables in linear scan allocation. The algorithm assumes registers are initially allocated based on linear scan algorithm. When there is a need to spill variables, either the allocated or the new variable is spilled based on the cost incurred in allocation. The cost is calculated as a function of number of definitions and uses of a variable for the rest of its live range. A mathematical model for determining the cost is proposed which decides register allocation. Given the live ranges of the variables the time complexity of the algorithm is derived. Simulations on an arbitrary program showed an improvement when compared to linear scan algorithm.

Read the paper · More papers on PaperTik