Abstract
A graph-coloring approach is widely used for register allocation, but its efficiency is limited because its formulation is too abstracted to use information about program context. This paper proposes a new register allocation technique that improves the efficiency by using information about the flow of variable references of a program. In the new approach, register allocation is performed at every reference of a variable in the order of the variable reference flow. For each reference, the costs of various possible register allocations are estimated by tracing a possible instruction sequence resulting from register allocations. A cost model is formulated to reduce the scope of the trace. Experimental results show that the proposed approach reduces spill code by an average of 34.3% and 17.8% in 8 benchmarks when compared to the Briggs’ allocator and the interference region spilling allocator, respectively.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley Publishing Company, Reading Mass (1986)
Advanced RISC Machines Ltd: ARM Architecture Reference Manual. Document Number: ARM DDI 0100B, Advanced RISC Machines Ltd., (ARM) (1996)
Bergner, P., Dahl, P., Engebretsen, D., O’Keefe, M.: Spill code minimization via interference region spilling. In: Proceedings of the ACM PLDI 1997, June 1997, pp. 287–295 (1997)
Briggs, P., Cooper, K.D., Torczon, L.: Rematerialization. In: Proceedings of the ACM SIGPLAN 1992 Conference on Programming Language Design and Implementation, SIGPLAN Notices, June 1992, vol. 27(7), pp. 311–321 (1992)
Briggs, P., Cooper, K.D., Kennedy, K., Torczon, L.: Coloring heuristics for register allocation. In: Proceedings of the ACM SIGPLAN 1989 Conference on Programming Language Design and Implementation, SIGPLAN Notices, June 1989, vol. 24(6), pp. 275–284 (1989)
Chaitin, G.J.: Register allocation and spilling via coloring. In: Proceedings of the ACM SIGPLAN 1982 Symposium on Compiler Construction, SIGPLAN Notices, June 1982, vol. 17(6), pp. 98–105 (1982)
Chaitin, G.J., Auslander, M.A., Chandra, A.K., Cocke, J., Hopkins, M., Markstein, P.W.: Register allocation via coloring. Computer Languages 6, 47–57 (1981)
Fraser, C.W., Hanson, D.R.: A Retargetable C Compiler: Design and Implementation. Benjamin/Cummings, Redwood City CA (1995)
Farach, M., Liberatore, V.: On local register allocation. In: Proceedings of the 9th Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 564-573 (1998)
Goodwin, D.W., Wilken, K.D.: Optimal and near-optimal global register allocation using 0-1 integer programming. Software-Practice and Experience 26(8), 929–965 (1996)
Hsu, W.-C., Fischer, C.N., Goodman, J.R.: On the minimization of loads/stores in local register allocation. IEEE Transactions on Software Engineering 15(10), 1252–1260 (1989)
Kim, D.H.: Advanced compiler optimization for CalmRISC8 low-end embedded processor. In: Watt, D.A. (ed.) CC 2000. LNCS, vol. 1781, pp. 173–188. Springer, Heidelberg (2000)
Kolte, P., Harrold, M.J.: Load/store range analysis for global register allocation. In: Proceedings of the ACM PLDI 1993, June 1993, pp. 268–277 (1993)
Mushnick, S.S.: Advanced compiler design and implementation. Morgan Kaufmann, SanFrancisco (1997)
Proebsting, T.A., Fischer, C.N.: Demand-driven register allocation. ACM Transactions on Programming Languages and Systems 18(6), 683–710 (1996)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2003 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Kim, DH., Lee, HJ. (2003). Fine-Grain Register Allocation Based on a Global Spill Costs Analysis. In: Krall, A. (eds) Software and Compilers for Embedded Systems. SCOPES 2003. Lecture Notes in Computer Science, vol 2826. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-39920-9_18
Download citation
DOI: https://doi.org/10.1007/978-3-540-39920-9_18
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-20145-8
Online ISBN: 978-3-540-39920-9
eBook Packages: Springer Book Archive