10.1145/512529.512534acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article

Fast copy coalescing and live-range identification

Published:17 May 2002Publication History

ABSTRACT

This paper presents a fast new algorithm for modeling and reasoning about interferences for variables in a program without constructing an interference graph. It then describes how to use this information to minimize copy insertion for ϕ-node instantiation during the conversion of the static single assignment (SSA) form into the control-flow graph (CFG), effectively yielding a new, very fast copy coalescing and live-range identification algorithm.This paper proves some properties of the SSA form that enable construction of data structures to compute interference information for variables that are considered for folding. The asymptotic complexity of our SSA-to-CFG conversion algorithm is where-is the number of instructions in the program.Performing copy folding during the SSA-to-CFG conversion eliminates the need for a separate coalescing phase while simplifying the intermediate code. This may make graph-coloring register allocation more practical in just in time (JIT) and other time-critical compilers For example, Sun's Hotspot Server Compiler already employs a graph-coloring register allocator[10].This paper also presents an improvement to the classical interference-graph based coalescing optimization that shows adecrease in memory usage of up to three orders of magnitude and a decrease of a factor of two in compilation time, while providing the exact same results.We present experimental results that demonstrate that our algorithm is almost as precise (within one percent on average) as the improved interference-graph-based coalescing algorithm, while requiring three times less compilation time.

References

  1. Preston Briggs. Register Allocation via Graph Coloring. PhD thesis, Rice University, April 1992 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Preston Briggs, Keith D. Cooper, Timothy J. Harvey, and L. Taylor Simpson. Practical improvements to the construction and destruction of static single assignment form. Software -- Practice and Experience, 28(8):859--881, July 1998 Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Zoran Budimli. Compiling Java for High Performance and the Internet. PhD thesis, Rice University, January 2001 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Gregory J. Chaitin. Register allocation and spilling via graph coloring. SIGPLAN Notices, 17(6):98--105, June 1982. Proceedings of the ACM SIGPLAN '82 Symposium on Compiler Construction Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Gregory J. Chaitin, Marc A. Auslander, Ashok K. Chandra, John Cocke, Martin E. Hopkins, and Peter W. Markstein. Register allocation via coloring. Computer Languages, 6:47--57, January 1981Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Keith D. Cooper, Timothy J. Harvey, and Linda Torczon. How to build an interference graph. Software -- Practice and Experience, 28(4):425--444, April 1998 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Thomas H. Cormen, Charles E. Leiserson, and Ronald L. Rivest. Introduction to Algorithms. M.I.T. Press, Cambridge, Massachusetts, U.S.A., 1990 Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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. ACM Transactions on Programming Languages and Systems, 13(4):451--490, October 1991 Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. George E. Forsythe, Michael A. Malcolm, and Cleve B. Moler. Computer Methods for Mathematical Computations. Prentice-Hall, Englewood Cliffs, New Jersey, 1977 Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. The Java Hotspot Virtual Machine, Technical White Paper, April 2001Google ScholarGoogle Scholar
  11. Robert Endre Tarjan. Testing flow graph reducibility. Journal of Computer and System Sciences, 9:355--365, 1974Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Fast copy coalescing and live-range identification

    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 '02: Proceedings of the ACM SIGPLAN 2002 conference on Programming language design and implementation
      June 2002
      338 pages
      ISBN:1581134630
      DOI:10.1145/512529

      Copyright © 2002 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 17 May 2002

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • Article

      Acceptance Rates

      PLDI '02 Paper Acceptance Rate28of169submissions,17%Overall Acceptance Rate406of2,067submissions,20%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!