A Fast Cutting-Plane Algorithm for Optimal Coalescing

  • Daniel Grund
  • Sebastian Hack
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4420)


Recent work has shown that the subtasks of register allocation (spilling, register assignment, and coalescing) can be completely separated. This work presents an algorithm for the coalescing subproblem that relies on this separation. The algorithm uses 0/1 Linear Programming (ILP), a general-purpose optimization technique, to derive optimal solutions.

We provide the first optimal solutions for a benchmark called “Optimal Coalescing Challenge”, i.e., our ILP model outperforms previous approaches. Additionally, we use these optimal solutions to assess the quality of well-known heuristics. A second benchmark on SPEC CPU2000 programs emphasizes the practicality of our algorithm.


Integer Linear Programming Chordal Graph Integer Linear Programming Model Integer Linear Programming Formulation Register Allocation 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. 1.
    Chaitin, G.J.: Register allocation & spilling via graph coloring. In: SIGPLAN symposium on Compiler construction, Boston, Massachusetts, United States, ACM Press, New York (1982)Google Scholar
  2. 2.
    Briggs, P., Cooper, K.D., Torczon, L.: Improvements to graph coloring register allocation. ACM Trans. Program. Lang. Syst. 16(3) (1994), doi:10.1145/177492.177575Google Scholar
  3. 3.
    George, L., Appel, A.: Iterated Register Coalescing. ACM TOPLAS 18(3) (1996), doi:10.1145/229542.229546Google Scholar
  4. 4.
    Park, J., Moon, S.-M.: Optimistic Register Coalescing. ACM TOPLAS 26(4) (2004), doi:10.1145/1011508.1011512Google Scholar
  5. 5.
    Goos, G., Hack, S., Grund, D.: Register Allocation for Programs in SSA-Form. In: Mycroft, A., Zeller, A. (eds.) CC 2006 and ETAPS 2006. LNCS, vol. 3923, pp. 247–262. Springer, Heidelberg (2006)Google Scholar
  6. 6.
    Appel, A., George, L.: Optimal Spilling for CISC Machines with Few Registers. Technical report, Princeton University (2000)Google Scholar
  7. 7.
    Appel, A.: Optimal Coalescing Challenge (2000),
  8. 8.
    Hack, S.: Register Allocation for Programs in SSA-Form (to appear). PhD thesis, University of Karlsruhe (2006)Google Scholar
  9. 9.
    Schrijver, A.: Theory of Linear and Integer Programming. J. Wiley & Sons, Chichester (1986)zbMATHGoogle Scholar
  10. 10.
    Nemhauser, G.L., Wolsey, L.A.: Integer and Combinatorial Optimization. Wiley-Interscience, New York (1988)zbMATHGoogle Scholar
  11. 11.
    Hack, S., Grund, D., Goos, G.: Towards Register Allocation for Programs in SSA-form. Technical report, University of Karlsruhe (2005)Google Scholar
  12. 12.
    Biró, M., Hujter, M., Tuza, Z.: Precoloring extension. I. Interval graphs. Discrete Mathematics 100 (1992)Google Scholar
  13. 13.
    Garey, M.R., Johnson, D.S.: Computers and Intractability: A Guide to the Theory of NP-Completeness. W.H. Freeman, New York (1979)zbMATHGoogle Scholar
  14. 14.
    Gavril, F.: Algorithms for Minimum Coloring, Maximum Clique, Minimum Covering by Cliques, and Independent Set of a Chordal Graph. SIAM Journal on Computing 1(2) (1972)Google Scholar
  15. 15.
    Appel, A., George, L.: Optimal Spilling for CISC Machines with Few Registers. In: ACM SIGPLAN Conference PLDI (2001)Google Scholar
  16. 16.
    Standard Performance Evaluation Corp. (2000),
  17. 17.
    Lindenmaier, G., et al.: Firm, an Intermediate Language for Compiler Research. Technical Report 2005-8, University of Karlsruhe (2005)Google Scholar
  18. 18.
    Goodwin, D.W., Wilken, K.D.: Optimal and Near-optimal Global Register Allocations Using 0-1 Integer Programming. Softw. Pract. Exper. 26(8) (1996)Google Scholar
  19. 19.
    Fu, C., Wilken, K.: A Faster Optimal Register Allocator. In: Proceedings of the ACM/IEEE international symposium on Microarchitecture, Istanbul, Turkey, IEEE Computer Society Press, Los Alamitos (2002)Google Scholar

Copyright information

© Springer Berlin Heidelberg 2007

Authors and Affiliations

  • Daniel Grund
    • 1
  • Sebastian Hack
    • 2
  1. 1.Department of Computer Science, Saarland University 
  2. 2.Department of Computer Science, University of Karlsruhe 

Personalised recommendations