skip to main content
10.1145/277650.277714acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article
Free Access

Quality and speed in linear-scan register allocation

Authors Info & Claims
Published:01 May 1998Publication History

ABSTRACT

A linear-scan algorithm directs the global allocation of register candidates to registers based on a simple linear sweep over the program being compiled. This approach to register allocation makes sense for systems, such as those for dynamic compilation, where compilation speed is important. In contrast, most commercial and research optimizing compilers rely on a graph-coloring approach to global register allocation. In this paper, we compare the performance of a linear-scan method against a modern graph-coloring method. We implement both register allocators within the Machine SUIF extension of the Stanford SUIF compiler system. Experimental results show that linear scan is much faster than coloring on benchmarks with large numbers of register candidates. We also describe improvements to the linear-scan approach that do not change its linear character, but allow it to produce code of a quality near to that produced by graph coloring.

References

  1. 1.D.S. Blickstein, P. W. Craig, C. S. Davidson, R. N. Faiman, K. D. Glossop, R. P. Grove, S. O. Hobbs and W. B. Noyce, "The GEM Optimizing Compiler System," Digital Equipment Corporation Technical Journal, 4(4)'121-135, 1992.Google ScholarGoogle Scholar
  2. 2.P. Briggs, K. Cooper, and L. Torczon, "Improvements to Graph Coloring Register Allocation," A CM Transactions on Programming Languages and Systems, 16(3):428-455, May 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 3.C.K. Burmeister, K. W. Harris, W. B. Noyce and S. O. Hobbs, U.S. patent number 5,339,428.Google ScholarGoogle Scholar
  4. 4.G. Chaitin et al., "Register Allocation via Coloring," Computer Languages, 6, pp. 47-57, 1981.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 5.G.J. Chaitin, "Register Allocation and Spilling via Graph Coloring," SIGPLAN Notices, 17(6):201-107, June 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 6.M.F. Fernandez, "Simple and Effective Link-time Optimization of Modula-3 Programs," SIGPLAN Notices, 30(6):103-115, June 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 7.L. George and A. Appel, "Iterated Register Coalescing,'' A CM Transactions on Programming Languages and Systems, 18(3):300-324, May 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 8.L.J. Hendren, G. R. Gao, E. R. Altman and C. Mukerji, "A Register Allocation Framework Based on Hierarchical Cyclic Interval Graphs," Proc. 4th International Compiler Construction Conference, pp. 176-191, October 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 9.S.O. Hobbs, Personal communication, July 1997.Google ScholarGoogle Scholar
  10. 10.U. Hoeltze, "Adaptive Optimization for Self: Reconciling High Performance with Exploratory Programming," Ph.D. thesis, Stanford University, March 1995.Google ScholarGoogle Scholar
  11. 11.B. Leverett, "Register Allocation in Optimizing Compilers,'' Ph.D. thesis, CMU-CS-81-103, Carnegie-Mellon University, February 1981. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 12.R. Morgan, Building an Optimizing Compiler, Digital Press, Boston, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 13.M. Poletto, D. R. Engler and M. F. Kaashoek, "tcc: a System for Fast, Flexible and High-level Dynamic Code Generation," SIGPLAN Notices, 32(5): 109-121, May 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. 14.M. Smith, "Extending SUIF for Machine-dependent Optimizations," Proc. First SUIF Compiler Workshop, Stanford, CA, pp. 14-25, January 1996. URL: http:// www'eecs'harvard'edu/machsuif'Google ScholarGoogle Scholar
  15. 15.D. W. Wall, "Global Register Allocation at Link Time," SIGPLftN Notices, 21(7):264-275, July 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 16.R. Wilson et al., "SUIF: An Infrastructure for Research on Parallelizing and Optimizing Compilers," A CM SIGPLAN Notices, 29 (1994), pp. 31-37. URL: http:// suif.stanford.edu. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 17.W. Wulf, R. K. Johnsson, C. B. Weinstock, S. O. Hobbs and C. M. Geschke, The Design of an Optimizing Compiler, American Elsevier, New York, 1975. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Quality and speed in linear-scan 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
                PLDI '98: Proceedings of the ACM SIGPLAN 1998 conference on Programming language design and implementation
                May 1998
                357 pages
                ISBN:0897919874
                DOI:10.1145/277650

                Copyright © 1998 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: 1 May 1998

                Permissions

                Request permissions about this article.

                Request Permissions

                Check for updates

                Qualifiers

                • Article

                Acceptance Rates

                PLDI '98 Paper Acceptance Rate31of136submissions,23%Overall Acceptance Rate406of2,067submissions,20%

                Upcoming Conference

                PLDI '24

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader