Abstract
Optimizing compilers play an important role for the efficient execution of programs written in high level programming languages. Current microprocessors impose the problem that the gap between processor cycle time and memory latency increases. In order to fully exploit the potential of processors, nearly optimal register allocation is of paramount importance. In the predominance of the x86 architecture and in the increased usage of high-level programming languages for embedded systems peculiarities and irregularities in their register sets have to be handled. These irregularities makes the task of register allocation for optimizing compilers more difficult than for regular architectures and register files. In this article we show how optimistic graph coloring register allocation can be extended to handle these irregularities. Additionally we present an exponential algorithm which in most cases can compute an optimal solution for register allocation and copy elimination. These algorithms are evaluated on a virtual processor architecture modeling two and three operand architectures with different register file sizes. The evaluation demonstrates that the heuristic graph coloring register allocator comes close to the optimal solution for large register files, but performs badly on small register files. For small register files the optimal algorithm is fast enough to replace a heuristic algorithm.
This research is partially supported by the Christian Doppler Forschungsgesellschaft as part of the Project “Compilation Techniques for Embedded Processors”
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Briggs, K.D.C.P., Kennedy, K., Torczon, L.: Coloring heuristics for register allocation. SIGPLAN Notices 24(7), 275–284 (1989)
Briggs, P., Cooper, K.D., Torczon, L.: Coloring register pairs. ACM Letters on Programming Languages and Systems (LOPLAS) 1(1), 3–13 (1992)
Briggs, P., Cooper, K.D., Torczon, L.: Improvements to graph coloring register allocation. ACM Transactions on Programming Languages and Systems (TOPLAS) 16(3), 428–455 (1994)
Chaitin, G.J.: Register allocation and spilling via graph coloring. ACM SIGPLAN Notices 17(6), 98–105 (1982)
Chow, F.C., Hennessy, J.L.: The priority-based coloring approach to register allocation. ACM Transactions on Programming Languages and Systems 12(4), 501–536 (1990)
Fu, C., Wilken, K.D.: A faster optimal register allocator. In: Proceedings of the 35st Annual ACM/IEEE International Symposium on Microarchitecture (MICRO 2002), Istanbul, November 18–22, pp. 245–256. IEEE Computer Society, Los Alamitos (2002)
George, L., Appel, A.W.: Iterated register coalescing. ACM Transactions on Programming Languages and Systems 18(3), 300–324 (1996)
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)
Kong, T., Wilken, K.D.: Precise register allocation for irregular register architectures. In: Proceedings of the 31st Annual ACM/IEEE International Symposium on Microarchitecture (MICRO 1998), Los Alamitos, November 30–December 2, pp. 297–307. IEEE Computer Society, Los Alamitos (1998)
Park, J., Moon, S.-M.: Optimistic register coalescing. In: Proceedings of the 1998 International Conference on Parallel Architectures and Compilation Techniques (PACT 1998), Paris, France, October 12–18, pp. 196–204. IEEE Computer Society Press, Los Alamitos (1998)
Scholz, B., Eckstein, E.: Register allocation for irregular register architectures. In: Proceedings of the International Conference of Languages, Compilers and Tools for Embedded Systems (LCTES 2002) and SCOPES 2002, Berlin, June 2002, ACM, New York (2002)
Smith, M.D., Holloway, G.: Graph-coloring register allocation for irregular architectures. Technical report, Harvard University (2000)
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
Hirnschrott, U., Krall, A., Scholz, B. (2003). Graph Coloring vs. Optimal Register Allocation for Optimizing Compilers. In: Böszörményi, L., Schojer, P. (eds) Modular Programming Languages. JMLC 2003. Lecture Notes in Computer Science, vol 2789. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-45213-3_26
Download citation
DOI: https://doi.org/10.1007/978-3-540-45213-3_26
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-40796-6
Online ISBN: 978-3-540-45213-3
eBook Packages: Springer Book Archive