skip to main content
10.1145/1772954.1772978acmconferencesArticle/Chapter ViewAbstractPublication PagescgoConference Proceedingsconference-collections
research-article

Coloring-based coalescing for graph coloring register allocation

Published:24 April 2010Publication History

ABSTRACT

Graph coloring register allocation tries to minimize the total cost of spilled live ranges of variables. Live-range splitting and coalescing are often performed before the coloring to further reduce the total cost. Coalescing of split live ranges, called sub-ranges, can decrease the total cost by lowering the interference degrees of their common interference neighbors. However, it can also increase the total cost because the coalesced sub-ranges can become uncolorable. In this paper, we propose coloring-based coalescing, which first performs trial coloring and next coalesces all copyrelated sub-ranges that were assigned the same color. The coalesced graph is then colored again with the graph coloring register allocation. The rationale is that coalescing of differently colored sub-ranges could result in spilling because there are some interference neighbors that prevent them from being assigned the same color. Experiments on Java programs show that the combination of live-range splitting and coloring-based coalescing reduces the static spill cost by more than 6% on average, comparing to the baseline coloring without splitting. In contrast, well-known iterated and optimistic coalescing algorithms, when combined with splitting, increase the cost by more than 20%. Coloring-based coalescing improves the execution time by up to 15% and 3% on average, while the existing algorithms improve by up to 12% and 1% on average.

References

  1. Appel, A. W. and George, L. Optimal spilling for CISC machines with few registers. In Proceedings of the ACM SIGPLAN 2001 Conference on Programming Language Design and Implementation, pages 243--253, June 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Bernstein, D., Golumbic, M. C., Mansour, Y., Pinter, R. Y., Goldin, D. Q., Krawczyk, H., and Nahshon, I. Spill code minimization techniques for optimizing compliers, In Proceedings of the ACM SIGPLAN 1989 Conference on Programming Language Design and Implementation, pages 258--263, July 1989 Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Bouchez, F., Darte, A., and Rastello, F. Advanced conservative and optimistic register coalescing. In Proceedings of the 2008 International Conference on Compilers, Architectures and Synthesis for Embedded Systems, pages 147--156, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Bouchez, F., Darte, A., and Rastello, F. On the complexity of register coalescing. In Proceedings of the International Symposium on Code Generation and Optimization 2007, pages 102--114, March 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Briggs, P. Register Allocation via Graph Coloring. PhD thesis, Rice University, April 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Briggs, P., Cooper, K. D., and Torczon, L. Improvements to graph coloring register allocation. ACM Transactions on Programming Languages and Systems, Vol. 16, No. 3, pages 428--455, May 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Chaitin, G. J. Register allocation and spilling via graph coloring. In Proceedings of the ACM SIGPLAN 1982 Symposium on Compiler Construction, pages 201--207, SIGPLAN Notices Vol. 17, No. 6, pages 98--105, June 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Chaitin, G. J., Auslander, M. A., Chandra, A. K., Cocke, J., Hopkins, M. E., and Markstein, P. W. Register allocation via coloring. Computer Languages, Vol. 6, No. 1, pages 47--57, January 1981.Google ScholarGoogle Scholar
  9. DaCapo Benchmarks, http://dacapobench.org/.Google ScholarGoogle Scholar
  10. George, L. and Appel, A. W. Iterated register coalescing. ACM Transactions on Programming Languages and Systems, Vol. 18, No. 3, pages 300--324, May 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Grcevski, N., Kilstra, A., Stoodley, K., Stoodley, M., and Sundaresan, V. Java just-in-time compiler and virtual machine improvements for server and middleware applications. In Proceedings of the 3rd Virtual Machine Research and Technology Symposium, pages 151--162, May, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Hack, S. and Goos, G. Copy coalescing by graph recoloring. In Proceedings of the ACM SIGPLAN 2008 Conference on Programming Language Design and Implementation, pages 227--237, June 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Hack, S., Grund, D., and Goos, G. Register allocation for programs in SSA-form. In International Conference on Compiler Construction (CC'06), Vol. 3923 of LNCS, pages 247--262, Springer Verlag, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Hailperin, M. Comparing conservative coalescing criteria. ACM Transactions on Programming Languages and Systems, Vol. 27, No. 3, pages 571--582, May 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. IBM System z9. IBM Journal of Research and Development Vol. 51, Number 1/2, 2007.Google ScholarGoogle Scholar
  16. Kolte, P. and Harrold, M. J. Load/store range analysis for global register allocation. In Proceedings of the ACM SIGPLAN 1994 Conference on Programming Language Design and Implementation, pages 268--277, June 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Leung, A. and George, L. A new MLRISC register allocator. Standard ML of New Jersey compiler implementation notes, 1998.Google ScholarGoogle Scholar
  18. Nakaike, T., Inagaki, T., Komatsu, H., and Nakatani, T. Profile-based global live-range splitting. In Proceedings the ACM SIGPLAN 2006 Conference on Programming Language Design and Implementation, pages 216--227, June 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Park, J. and Moon, S. Optimistic Register Coalescing. ACM Transactions on Programming Languages and Systems, Vol. 26, No. 4, pages 735--765, July 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Vegdahl, S. R. Using node merging to enhance graph coloring. In Proceedings of the ACM SIGPLAN 1999 Conference on Programming Language Design and Implementation, pages 150--154, May 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Standard Performance Evaluation Corporation. SPECjvm98 Benchmarks, http://www.spec.org/osg/jvm98/.Google ScholarGoogle Scholar

Index Terms

  1. Coloring-based coalescing for graph coloring register allocation

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      CGO '10: Proceedings of the 8th annual IEEE/ACM international symposium on Code generation and optimization
      April 2010
      300 pages
      ISBN:9781605586359
      DOI:10.1145/1772954

      Copyright © 2010 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 24 April 2010

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate312of1,061submissions,29%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader