Abstract

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.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.