skip to main content
10.1145/1988932.1988934acmotherconferencesArticle/Chapter ViewAbstractPublication PagesscopesConference Proceedingsconference-collections
research-article

Decoupled graph-coloring register allocation with hierarchical aliasing

Published:27 June 2011Publication History

ABSTRACT

Recent results have shown how to do graph-coloring-based register allocation in a way that decouples spilling from register assignment. This decoupled approach has the main advantage of simplifying the implementation of register allocators. However, the decoupled model, as described in previous works, faces many problems when dealing with register aliasing, a phenomenon typical in architectures usually seen in embedded systems, such as ARM. In this paper we introduce the semi-elementary form, a program representation that brings decoupled register allocation to architectures with register aliasing. The semi-elementary form is much smaller than program representations used by previous decoupled solutions; thus, leading to register allocators that perform better in terms of time and space. Furthermore, this representation reduces the number of copies that traditional allocators insert into assembly programs. We have empirically validated our results by showing how our representation improves two well known graph coloring based allocators, namely the Iterated Register Coalescer (IRC), and Bouchez et al.'s brute force (BF) method, both augmented with Smith et al. extensions to handle aliasing. Running our techniques on SPEC CPU 2000, we have reduced the number of nodes in the interference graphs by a factor of 4 to 5; hence, speeding-up allocation time by a factor of 3 to 5. Additionally the semi-elementary form reduces by 8% the number of copies that IRC leaves uncoalesced.

References

  1. Andrew W. Appel and Lal George. Optimal spilling for CISC machines with few registers. In PLDI, pages 243--253. ACM, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Andrew W. Appel and Jens Palsberg. Modern Compiler Implementation in Java. Cambridge University Press, 2nd edition, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Florent Bouchez. Allocation de registres et vidage en mémoire. Master's thesis, ENS Lyon, October 2005.Google ScholarGoogle Scholar
  4. Florent Bouchez, Quentin Colombet, Alain Darte, Fabrice Rastello, and Christophe Guillon. Parallel copy motion. In SCOPES, pages 1--10. ACM, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Florent Bouchez, Alain Darte, and Fabrice Rastello. On the complexity of register coalescing. In CGO, pages 102--104. IEEE, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Florent Bouchez, Alain Darte, and Fabrice Rastello. Advanced conservative and optimistic register coalescing. In CASES, pages 147--156. ACM, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Preston Briggs, Keith D. Cooper, and Linda Torczon. Improvements to graph coloring register allocation. TOPLAS, 16(3):428--455, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Gregory J. Chaitin, Mark A. Auslander, Ashok K. Chandra, John Cocke, Martin E. Hopkins, and Peter W. Markstein. Register allocation via coloring. Computer Languages, 6:47--57, 1981.Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Ron Cytron, Jeanne Ferrante, Barry K. Rosen, Mark N. Wegman, and F. Kenneth Zadeck. Efficiently computing static single assignment form and the control dependence graph. TOPLAS, 13(4):451--490, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Janet Fabri. Automatic storage optimization. In CC, pages 83--91. ACM, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Lal George and Andrew W. Appel. Iterated register coalescing. TOPLAS, 18(3):300--324, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Sebastian Hack and Gerhard Goos. Copy coalescing by graph recoloring. In PLDI, pages 227--237. ACM, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Sebastian Hack, Daniel Grund, and Gerhard Goos. Register allocation for programs in SSA-form. In CC, pages 247--262. Springer-Verlag, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. A. B. Kempe. On the geographical problem of the four colors. American Journal of Mathematics, 2(1):193--200, 1879.Google ScholarGoogle ScholarCross RefCross Ref
  15. Timothy Kong and Kent D Wilken. Precise register allocation for irregular architectures. In MICRO, pages 297--307. IEEE, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Chris Lattner and Vikram S. Adve. LLVM: A compilation framework for lifelong program analysis & transformation. In CGO, pages 75--88. IEEE, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Jonathan K. Lee, Jens Palsberg, and Fernando M. Q. Pereira. Aliased register allocation. In ICALP, 2007.Google ScholarGoogle Scholar
  18. V. Krishna Nandivada, Fernando Pereira, and Jens Palsberg. A framework for end-to-end verification and evaluation of register allocators. In SAS, pages 153--169. Springer, Kongens Lyngby, Denmark, August 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Fernando Magno Quintao Pereira and Jens Palsberg. Register allocation via coloring of chordal graphs. In APLAS, pages 315--329. Springer, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Fernando Magno Quintao Pereira and Jens Palsberg. Register allocation by puzzle solving. In PLDI, pages 216--226. ACM, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Fernando Magno Quintao Pereira and Jens Palsberg. SSA elimination after register allocation. In CC, pages 158--173, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Fernando Magno Quintão Pereira and Jens Palsberg. Punctual coalescing. In CC, pages 165--184, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Hongbo Rong. Tree register allocation. In MICRO, pages 67--77. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Vivek Sarkar and Rajkishore Barik. Extended linear scan: an alternate foundation for global register allocation. In LCTES/CC, pages 141--155. ACM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Bernhard Scholz and Erik Eckstein. Register allocation for irregular architectures. In LCTES/SCOPES, pages 139--148. ACM, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Michael D. Smith, Norman Ramsey, and Glenn Holloway. A generalized algorithm for graph-coloring register allocation. In PLDI, pages 277--288. ACM, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Christian Wimmer and Michael Franz. Linear scan register allocation on SSA form. In CGO, pages 170--179. ACM, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Decoupled graph-coloring register allocation with hierarchical aliasing

            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 Other conferences
              SCOPES '11: Proceedings of the 14th International Workshop on Software and Compilers for Embedded Systems
              June 2011
              75 pages
              ISBN:9781450307635
              DOI:10.1145/1988932

              Copyright © 2011 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: 27 June 2011

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • research-article

              Acceptance Rates

              Overall Acceptance Rate38of79submissions,48%

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader