skip to main content
article
Free Access

Using node merging to enhance graph coloring

Published:01 May 1999Publication History
Skip Abstract Section

Abstract

A Chaitin-style register allocator often blocks during its simplification phase because no node in the interference graph has a degree that is sufficiently small. Typically, this is handled by node-splitting, or by optimistically continuing---and hoping that a legal N-coloring will still be found. We observe that the merging of two nodes in a graph causes a reduction in the degree of any node that had been adjacent to both. We have enhanced Chaitin's coloring algorithm so that it attempts node-merging during graph simplification; this often allows simplification to continue, while still guaranteeing a coloring for the graph. We have tested this algorithm using Appel's database of register-coloring graphs, and have compared it with Chaitin's algorithm. The merge-enhanced algorithm yields a better coloring about 8% of the time, and a worse coloring less than 0.1% of the time.

References

  1. 1 Appel, A. Sample Graph Coloring Problems. URL: http:// www. cs.princeton.edu/fac/appel/~aphdata (1996).Google ScholarGoogle Scholar
  2. 2 Appel, A. Modem Compiler Implementation in Java. Cambridge University Press (1998). Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 3 Bergner, P., Dahl, P, Engebretsen, D. and O'Keefe, M. Spill Code Minimization via Interference Region Spilling. SIG- PLAN Notices 32, 5 (May 1997), 287-295. Proc. A CM SIG. PLAN '97 Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4 Blum, M., Floyd, R., Pratt, V., Rivest, R. and Tarjan, R. Time Bounds for Selection. Journal of Computer and System Sciences, 7,4 (1972), 448--461.Google ScholarGoogle Scholar
  5. 5 Briggs, P., Cooper, D. and Torczon, L. Improvements to Graph Coloring Register Allocation. A CM Trans Programming Languages and Systems, 12,4 (Oct. 1990), 501-536. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 6 Chaitin, G., Auslander, M., Chandra, A.,eocke, J. Hopkins, M. and Markstein, P. Register Allocation via Coloring. Computer Languages 6(1981), 47-57.Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 7 Chaitin, G. Register Allocation and Spilling via Graph Coloring. SIGPLAN Notices 17, 6 (June 1992), 257-265. Proc. A CM SIGPLAN '82 Symposium on Compiler Construction. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 8 Chow, E and Hennessy, J. The Priority-Based Coloring Approach to Register Allocation. ACM Trans Programming Languages and Systems, 12,4 (Oct. 1990), 501-536. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 9 George, L. and Appel, A. Iterated register coalescing. ACM Trans. on Programming Languages and Systems, 18, 3 (May 1996), 300-324. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 10 Kurlander, S. and Fischer, C. Zero-Cost Range Splitting. SIG- PLAN Notices 29, 6 (June 1994), 257-265. Proc. ACM SIG- PLAN '94 Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 11 Lueh, G. and Gross, T. Call-Cost Directed Register Allocation. SIGPLAN Notices 32, 5 (May 1997), 296-307. Proc. A CM SIGPLAN '97 Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 12 Park, J. and Moon, S. Optimistic Register Coalescing. Proc. 1998 International Conference on Parallel Architectures and Compilation Techniques (1998), 196-204. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Using node merging to enhance graph coloring

        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 34, Issue 5
          May 1999
          304 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/301631
          Issue’s Table of Contents
          • cover image ACM Conferences
            PLDI '99: Proceedings of the ACM SIGPLAN 1999 conference on Programming language design and implementation
            May 1999
            304 pages
            ISBN:1581130945
            DOI:10.1145/301618

          Copyright © 1999 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 1999

          Check for updates

          Qualifiers

          • article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader