Skip to main content

Graph Coloring vs. Optimal Register Allocation for Optimizing Compilers

  • Conference paper
Book cover Modular Programming Languages (JMLC 2003)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2789))

Included in the following conference series:

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”

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Briggs, K.D.C.P., Kennedy, K., Torczon, L.: Coloring heuristics for register allocation. SIGPLAN Notices 24(7), 275–284 (1989)

    Article  Google Scholar 

  2. Briggs, P., Cooper, K.D., Torczon, L.: Coloring register pairs. ACM Letters on Programming Languages and Systems (LOPLAS) 1(1), 3–13 (1992)

    Article  Google Scholar 

  3. 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)

    Article  Google Scholar 

  4. Chaitin, G.J.: Register allocation and spilling via graph coloring. ACM SIGPLAN Notices 17(6), 98–105 (1982)

    Article  MathSciNet  Google Scholar 

  5. 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)

    Article  Google Scholar 

  6. 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)

    Google Scholar 

  7. George, L., Appel, A.W.: Iterated register coalescing. ACM Transactions on Programming Languages and Systems 18(3), 300–324 (1996)

    Article  Google Scholar 

  8. 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)

    Article  Google Scholar 

  9. 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)

    Chapter  Google Scholar 

  10. 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)

    Chapter  Google Scholar 

  11. 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)

    Google Scholar 

  12. Smith, M.D., Holloway, G.: Graph-coloring register allocation for irregular architectures. Technical report, Harvard University (2000)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics