skip to main content
article

Coloring heuristics for register allocation

Published:01 April 2004Publication History
Skip Abstract Section

Abstract

We describe an improvement to a heuristic introduced by Chaitin for use in graph coloring register allocation. Our modified heuristic produces better colorings, with less spill code. It has similar compile-time and implementation requirements. We present experimental data to compare the two methods.

References

  1. J. W. Backus, R. J. Beeber, S. Best, R. Goldberg, L. M. Haibt, H. L. Herrick, R. A. Nelson, D. Sayre, P. B. Sheridan, H. Stern, I. Ziller, R. A. Hughes, and R. Nutt. The FORTRAN automatic coding system. In Proceedings of the Western Joint Computer Conference, pages 188--198. Institute of Radio Engineers, NY, NY, USA, Feb. 1957.Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. P. Bergner, P. Dahl, D. Engebretsen, and M. O'Keefe. Spill code minimization via interference region spilling. SIGPLAN Notices, 32(6):287--295, June 1997. Proceedings of the ACM SIGPLAN '97 Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. D. Bernstein, D. Q. Goldin, M. C. Golumbic, H. Krawczyk, Y. Mansour, I. Nahshon, and R. Y. Pinter. Spill code minimization techniques for optimizing compilers. SIGPLAN Notices, 24(7):258--263, July 1989. Proceedings of the ACM SIGPLAN '89 Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. P. Briggs, K. D. Cooper, and L. Torczon. Coloring register pairs. ACM Letters on Programming Languages and Systems, 1(1):3--13, Mar. 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. P. Briggs, K. D. Cooper, and L. Torczon. Rematerialization. SIGPLAN Notices, 27(7):311--321, July 1992. Proceedings of the ACM SIGPLAN '92 Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. P. Briggs and L. Torczon. An efficient representation for sparse sets. ACM Letters on Programming Languages and Systems, 2(1--4):45--58, March--December 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. D. Callahan and B. Koblenz. Register allocation via hierarchical graph coloring. SIGPLAN Notices, 26(6):192--203, June 1991. Proceedings of the ACM SIGPLAN '91 Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. G. 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
  9. G. J. Chaitin, M. A. Auslander, A. K. Chandra, J. Cocke, M. E. Hopkins, and P. W. Markstein. Register allocation via graph coloring. Computer Languages, 6(1):47--57, Jan. 1981.Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. J.-D. Choi, R. Cytron, and J. Ferrante. Automatic construction of sparse data flow evaluation graphs. In Conference Record of the Eighteenth Annual ACM Symposium on Principles of Programming Languages, pages 55--66, Orlando, FL, USA, Jan. 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. F. C. Chow and J. L. Hennessy. Register allocation by priority-based coloring. SIGPLAN Notices, 19(6):222--232, June 1984. Proceedings of the ACM SIGPLAN '84 Symposium on Compiler Construction. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. K. D. Cooper, T. J. Harvey, and L. Torczon. How to build an interference graph. Software---Practice and Experience, 28(4):425--444, Apr. 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. K. D. Cooper and L. T. Simpson. Live range splitting in a graph coloring register allocator. In Proceedings of the Seventh International Compiler Construction Conference, CC '98, Lecture Notes in Computer Science 1383, pages 174--187, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. L. George and A. W. Appel. Iterated register coalescing. ACM Transactions on Programming Languages and Systems, 18(3):300--324, May 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. R. Gupta, M. L. Soffa, and T. Steele. Register allocation via clique separators. SIGPLAN Notices, 24(7):264--274, July 1989. Proceedings of the ACM SIGPLAN '89 Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. J. R. Larus and P. N. Hilfinger. Register allocation in the SPUR Lisp compiler. SIGPLAN Notices, 21(7):255--263, July 1986. Proceedings of the ACM SIGPLAN '86 Symposium on Compiler Construction. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. S. S. Lavrov. Store economy in closed operator schemes. Journal of Computational Mathematics and Mathematical Physics, 1(4):687--701, 1961. English translation in U.S.S.R. Computational Mathematics and Mathematical Physics 3:810--828, 1962.Google ScholarGoogle Scholar
  18. D. Matula and L. Beck. Smallest-last ordering and clustering and graph coloring algorithms. Technical Report CSE-8104, Department of Computer Science and Engineering, Southern Methodist University, July 1981.Google ScholarGoogle Scholar
  19. B. R. Nickerson. Graph coloring register allocation for processors with multi-register operands. SIGPLAN Notices, 25(6):40--52, June 1990. Proceedings of the ACM SIGPLAN '90 Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. C. Norris and L. L. Pollock. Register allocation over the program dependence graph. SIGPLAN Notices, 29(6):266--277, June 1994. Proceedings of the ACM SIGPLAN '94 Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. J. Park and S.-M. Moon. Optimistic register coalescing. In Proceedings of the International Conference on Parallel Architectures and Compilation Techniques (PACT), pages 196--204. IEEE, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. {AuHo 82} M. Auslander and M. Hopkins. An overview of the PL.8 compiler. Proceedings of the SIGPLAN '82 Symposium on Compiler Construction, SIGPLAN Notices 17(6), June, 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. {CCHK 87} A. Carle, K. D. Cooper, R. T. Hood, K. Kennedy, L. Torczon, and S. K. Warren. A practical environment for scientific programming. IEEE Computer 20(11), November, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. {CeDT 84} M. R. Celis, J. E. Dennis, and R. A. Tapia. A trust region strategy for equality constrained optimization. In Numerical Optimization 1984 (P. T. Boggs, R. H. Byrd, and R. B. Schnabel, editors), SIAM, 1984.Google ScholarGoogle Scholar
  25. {Chai 82} G. J. Chaitin. Register allocation and spilling via graph coloring. Proceedings of the SIGPLAN '82 Symposium on Compiler Construction, SIGPLAN Notices 17(6), June, 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. {CACC 81} G. J. Chaitin, M. A. Auslander, A. K. Chandra, J. Cocke, M. E. Hopkins, and P. W. Markstein. Register allocation via coloring. Computer Languages 6, January, 1981.Google ScholarGoogle Scholar
  27. {Chow 83} F. Chow. A portable machine-independent global optimizer---design and measurements. PhD. Thesis. Technical Note No. 83--254, Computer Systems Laboratory, Stanford University, Dec. 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. {ChHe 84} F. Chow and J. Hennessy. Register allocation by priority based coloring. Proceedings of the SIGPLAN '84 Symposium on Compiler Construction, SIGPLAN Notices 19(6), June, 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. {CoKT 86} K. D. Cooper, K. Kennedy, and L. Torczon. The impact of interprocedural analysis and optimization in the IRn programming environment. ACM Transactions on Programming Languages and Systems 8(4), October, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. {DBMS 82} J. J. Dongarra, J. R. Bunch, C. B. Moler, and G. W. Stewart. LINPACK Users' Guide, SIAM, Philadelphia, PA., 1982.Google ScholarGoogle Scholar
  31. {Dong 83} J. J. Dongarra. Performance of various computers using standard linear equations software in a Fortran environment. Argonne National Laboratory Technical Memorandum 23, August 1983 and subsequent revisions.Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. {FoMM 77} G. E. Forsythe, M. A. Malcolm, and C. B. Moler. Computer Methods for Mathematical Computations, Prentice-Hall, Inc., Englewood Cliffs, NJ, 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. {LaHi 86} J. R. Larus and P. N. Hilfinger. Register allocation in the SPUR Lisp compiler. Proceedings of the SIGPLAN '86 Symposium on Compiler Construction, SIGPLAN Notices 21(7), June, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. {MaBe 81} D. Matula and L. Beck. Smallest-last ordering and clustering and graph coloring algorithms. TR CSE 8104, Dept. of Computer Science and Engineering, Southern Methodist University, Dallas, TX, July, 1981.Google ScholarGoogle Scholar
  35. {Torc 89} V. J. Torczon. Nonlinear optimization by parallel searches on simplex edges. PhD. Thesis, Department of Mathematical Sciences, Rice University, Houston, TX, expected May, 1989.Google ScholarGoogle Scholar
  36. {Wirt 76} N. Wirth. Algorithms + Data Structures = Programs. Prentice-Hall, Inc., Englewood Cliffs, NJ, 1976. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Coloring heuristics for register allocation
    Index terms have been assigned to the content through auto-classification.

    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

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 39, Issue 4
      20 Years of the ACM SIGPLAN Conference on Programming Language Design and Implementation 1979-1999: A Selection
      April 2004
      673 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/989393
      Issue’s Table of Contents

      Copyright © 2004 Authors

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 1 April 2004

      Check for updates

      Qualifiers

      • article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader