Live-range unsplitting for faster optimal coalescing

Register allocation is often a two-phase approach: spilling of registers to memory, followed by coalescing of registers. Extreme live-range splitting (i.e. live-range splitting after each statement) enables optimal solutions based on ILP, for both spilling and coalescing. However, while the solutions are easily found for spilling, for coalescing they are more elusive. This difficulty stems from the huge size of interference graphs resulting from live-range splitting. This paper focuses on coalescing in the context of extreme live-range splitting. It presents some theoretical properties that give rise to an algorithm for reducing interference graphs. This reduction consists mainly in finding and removing useless splitting points. It is followed by a graph decomposition based on clique separators. The reduction and decomposition are general enough, so that any coalescing algorithm can be applied afterwards. Our strategy for reducing and decomposing interference graphs preserves the optimality of coalescing. When used together with an optimal coalescing algorithm (e.g. ILP), optimal solutions are much more easily found. The strategy has been tested on a standard benchmark, the optimal coalescing challenge. For this benchmark, the cutting-plane algorithm for optimal coalescing (the only optimal algorithm for coalescing) runs 300 times faster when combined with our strategy. Moreover, we provide all the optimal solutions of the optimal coalescing challenge, including the three instances that were previously unsolved.

[1]  Robert E. Tarjan,et al.  Decomposition by clique separators , 1985, Discret. Math..

[2]  Andrew W. Appel,et al.  Modern Compiler Implementation in ML , 1997 .

[3]  John L. Hennessy,et al.  The priority-based coloring approach to register allocation , 1990, TOPL.

[4]  Thomas R. Gross,et al.  Fusion-based register allocation , 2000, TOPL.

[5]  Gregory J. Chaitin,et al.  Register allocation and spilling via graph coloring , 2004, SIGP.

[6]  Daniel Grund,et al.  A Fast Cutting-Plane Algorithm for Optimal Coalescing , 2007, CC.

[7]  Vivek Sarkar,et al.  Extended Linear Scan: An Alternate Foundation for Global Register Allocation , 2007, CC.

[8]  Kathryn Fraughnaugh,et al.  Introduction to graph theory , 1973, Mathematical Gazette.

[9]  Keith D. Cooper,et al.  Live Range Splitting in a Graph Coloring Register Allocator , 1998, International Conference on Compiler Construction.

[10]  Mary Jean Harrold,et al.  Load/store range analysis for global register allocation , 1993, PLDI '93.

[11]  Matthew T. O'Keefe,et al.  Spill code minimization via interference region spilling , 1997, PLDI '97.

[12]  Kent D. Wilken,et al.  Optimal and Near-Optimal Global Register Allocation Using 0-1 Integer Programming , 1996, Software, Practice & Experience.

[13]  Soo-Mook Moon,et al.  Optimistic register coalescing , 2004, TOPL.

[14]  Andrew W. Appel,et al.  Optimal spilling for CISC machines with few registers , 2001, PLDI '01.

[15]  Kent D. Wilken,et al.  Optimal and Near‐optimal Global Register Allocation Using 0–1 Integer Programming , 1996, Softw. Pract. Exp..

[16]  Fabrice Rastello,et al.  On the Complexity of Register Coalescing , 2007, International Symposium on Code Generation and Optimization (CGO'07).

[17]  Preston Briggs,et al.  Register allocation via graph coloring , 1992 .

[18]  D. West Introduction to Graph Theory , 1995 .

[19]  Florent Bouchez,et al.  Étude des problèmes de spilling et coalescing liés à l'allocation de registres en tant que deux phases distinctes. (A Study of Spilling and Coalescing in Register Allocation as Two Separate Phases) , 2009 .

[20]  Sandrine Blazy,et al.  Live-range Unsplitting for Faster Optimal Coalescing ( extended version ) , 2008 .

[21]  Rajiv Gupta,et al.  Efficient register allocation via coloring using clique separators , 1994, TOPL.

[22]  Mihalis Yannakakis,et al.  The Maximum k-Colorable Subgraph Problem for Chordal Graphs , 1987, Inf. Process. Lett..

[23]  Andrew W. Appel,et al.  Iterated register coalescing , 1996, POPL '96.