Skip to main content

Revisiting Graph Coloring Register Allocation: A Study of the Chaitin-Briggs and Callahan-Koblenz Algorithms

  • Conference paper
Languages and Compilers for Parallel Computing (LCPC 2005)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 4339))

Abstract

Techniques for global register allocation via graph coloring have been extensively studied and widely implemented in compiler frameworks. This paper examines a particular variant – the Callahan Koblenz allocator – and compares it to the Chaitin-Briggs graph coloring register allocator. Both algorithms were published in the 1990’s, yet the academic literature does not contain an assessment of the Callahan-Koblenz allocator. This paper evaluates and contrasts the allocation decisions made by both algorithms. In particular, we focus on two key differences between the allocators:

Spill code: The Callahan-Koblenz allocator attempts to minimize the effect of spill code by using program structure to guide allocation and spill code placement. We evaluate the impact of this strategy on allocated code.

Copy elimination: Effective register-to-register copy removal is important for producing good code. The allocators use different techniques to eliminate these copies. We compare the mechanisms and provide insights into the relative performance of the contrasting techniques.

The Callahan-Koblenz allocator may potentially insert extra branches as part of the allocation process. We also measure the performance overhead due to these branches.

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. Bergner, P., Dahl, P., Engebretsen, D., O’Keefe, M.T.: Spill Code Minimization via Interference Region Spilling. In: SIGPLAN Conference on Programming Language Design and Implementation, pp. 287–295 (1997)

    Google Scholar 

  2. Bernstein, D., Goldin, D.Q., Golumbic, M.C., Krawczyk, H., Mansour, Y., Nahshon, I., Pinter, R.Y.: Spill Code Minimization Techniques for Optimizing Compilers. In: SIGPLAN Conference on Programming Language Design and Implementation, pp. 258–263 (1989)

    Google Scholar 

  3. Briggs, P.: Register Allocation via Graph Coloring. Technical Report TR92- 183, Rice University, 24 (1992)

    Google Scholar 

  4. Briggs, P., Cooper, K.D., Harvey, T.J., Taylor Simpson, L.: Practical Improvements to the Construction and Destruction of Static Single Assignment. Form. Software - Practice and Experience 28(8), 859–881 (1998)

    Article  Google Scholar 

  5. Briggs, P., Cooper, K.D., Torczon, L.: Improvements to Graph Coloring Register Allocation. ACM Transactions on Programming Languages and Systems 16(3), 428–455 (1994)

    Article  Google Scholar 

  6. Callahan, D., Koblenz, B.: Register Allocation via Hierarchical Graph Coloring. SIGPLAN 26(6), 192–203 (1991)

    Article  Google Scholar 

  7. Chaitin, G.J.: Register Allocation and Spilling via Graph Coloring. In: SIGPLAN 1982 (1982)

    Google Scholar 

  8. Chaitin, G.J., Auslander, M.A., Chandra, A.K., Cocke, J., Hopkins, M.E., Markstein, P.W.: Register Allocation via Coloring. Computer Languages 6, 45–57 (1981)

    Article  Google Scholar 

  9. Cooper, K.D., Simpson, L.T.: Live range Splitting in a Graph Coloring Register Allocator. In: Proceedings of the International Compiler Construction Conference (March 1998)

    Google Scholar 

  10. George, L., Appel, A.W.: Iterated register coalescing. ACM Trans. Program. Lang. Syst. 18(3), 300–324 (1996)

    Article  Google Scholar 

  11. Kim, S., Moon, S.-M., Park, J., Ebciolu, K.: Unroll-based register coalescing. In: ICS 2000: Proceedings of the 14th international conference on supercomputing. ACM Press, New York (2000)

    Google Scholar 

  12. Knobe, K., Zadeck, K.: Register Allocation Using Control Trees. Technical Report CS-92-13, Brown University, Department of Computer Science (March 1992)

    Google Scholar 

  13. Koseki, A., Komatsu, H., Nakatani, T.: Preference-directed graph coloring. In: Proceedings of the ACM SIGPLAN 2002 Conference on Programming language design and implementation, pp. 33–44. ACM Press, New York (2002)

    Chapter  Google Scholar 

  14. Lattner, C., Adve, V.: LLVM: A Compilation Framework for Lifelong Program Analysis and Transformation. In: Proceedings of the 2004 International Symposium on Code Generation and Optimization (CGO 2004) (March 2004)

    Google Scholar 

  15. Geoffrey Lowney, P., Freudenberger, S.M., Karzes, T.J., Lichtenstein, W.D., Nix, R.P., O’Donnell, J.S., Ruttenberg, J.C.: The Multiflow Trace Scheduling Compiler. The Journal of Supercomputing 7(1-2), 51–142 (1993)

    Article  Google Scholar 

  16. Lueh, G.-Y., Gross, T., Adl-Tabatabai, A.-R.: Fusion-based register allocation. ACM Transactions on Programming Languages and Systems 22(3), 431–470 (2000)

    Article  Google Scholar 

  17. Norris, C., Pollock, L.L.: Register Allocation over the Program Dependence Graph. In: SIGPLAN Conference on Programming Language Design and Implementation, pp. 266–277 (1994)

    Google Scholar 

  18. Sethi, R.: Complete Register Allocation Problems. In: Proceedings of the fifth annual ACM symposium on Theory of computing, pp. 182–195. ACM, New York (1973)

    Chapter  Google Scholar 

  19. Wu, Q.: Register Allocation via Hierarchical Graph Coloring. Master’s thesis, Michigan Technological University (1996)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Cooper, K.D., Dasgupta, A., Eckhardt, J. (2006). Revisiting Graph Coloring Register Allocation: A Study of the Chaitin-Briggs and Callahan-Koblenz Algorithms. In: Ayguadé, E., Baumgartner, G., Ramanujam, J., Sadayappan, P. (eds) Languages and Compilers for Parallel Computing. LCPC 2005. Lecture Notes in Computer Science, vol 4339. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-69330-7_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-69330-7_1

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-69329-1

  • Online ISBN: 978-3-540-69330-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics