ABSTRACT
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.
- Andrew W. Appel. Modern Compiler Implementation in ML. Cambridge University Press, 1998. Google ScholarDigital Library
- Andrew W. Appel and Lal George. Optimal coalescing challenge, 2000. http://www.cs.princeton.edu/ appel/coalesceGoogle Scholar
- Andrew W. Appel and Lal George. Optimal spilling for {CISC} machines with few registers. In PLDI'01, pages 243--253, 2001. Google ScholarDigital Library
- Peter Bergner, Peter Dahl, David Engebretsen, et al. Spill code minimization via interference region spilling. In PLDI '97, pages 287--295, 1997. Google ScholarDigital Library
- Florent Bouchez. A Study of Spilling and Coalescing in Register Allocation as Two Separate Phases. PhD thesis, ENS Lyon, France, dec 2008.Google Scholar
- Florent Bouchez, Alain Darte, and Fabrice Rastello. On the complexity of register coalescing. In CGO'07, mar 2007. Google ScholarDigital Library
- Preston Briggs. Register Allocation via Graph Coloring. PhD thesis, Rice University, april 1992. Google ScholarDigital Library
- Philip Brisk, F.Dabiri, J.Macbeth, et al. Polynomial time graph coloring register allocation. In Workshop on Logic and Synthesis, 2005.Google Scholar
- G J Chaitin. Register allocation and spilling via graph coloring. Symposium on Compiler Construction, 17(6):98--105, 1982. Google ScholarDigital Library
- Fred C. Chow and John L. Hennessy. The priority-based coloring approach to register allocation. ACM TOPLAS, 12(4):501--536, 1990. Google ScholarDigital Library
- Keith D. Cooper and L. Taylor Simpson. Live range splitting in a graph coloring register allocator. In CC '98, pages 174--187, 1998. Google ScholarDigital Library
- Changqing Fu and Kent Wilken. A faster optimal register allocator. In MICRO 35, pages 245--256, 2002. Google ScholarDigital Library
- Lal George and Andrew W. Appel. Iterated register coalescing. ACM TOPLAS, 18(3):300--324, 1996. Google ScholarDigital Library
- David Goodwin and Kent Wilken. Optimal and near-optimal global register allocations using 0-1 integer programming. Softw. Pract. Exper., 26(8):929--965, 1996. Google ScholarDigital Library
- David W. Goodwin. Optimal and near-optimal global register allocation. PhD thesis, University of California, 1996.Google Scholar
- Daniel Grund and Sebastian Hack. A fast cutting-plane algorithm for optimal coalescing. In CC'07, LNCS, pages 111--125, 2007. Google ScholarDigital Library
- Rajiv Gupta, Mary Lou Soffa, and Denise Ombres. Efficient register allocation via coloring using clique separators. ACM TOPLAS., 16(3):370--386, 1994. Google ScholarDigital Library
- Priyadarshan Kolte and Mary Jean Harrold. Load/store range analysis for global register allocation. In PLDI'93, pages 268--277, 1993. Google ScholarDigital Library
- Guei-Yuan Lueh and Thomas Gross. Fusion-based register allocation. ACM TOPLAS, 22:2000, 1997. Google ScholarDigital Library
- Jinpyo Park and Soo-Mook Moon. Optimistic register coalescing. In PACT '98, page 196, 1998. Google ScholarDigital Library
- Vivek Sarkar and Rajkishore Barik. Extended linear scan: An alternate foundation for global register allocation. In CC'07, LNCS, pages 141--155, 2007. Google ScholarDigital Library
- Robert Endre Tarjan. Decomposition by clique separators. In Discrete Mathematics, 55(2):221--232, 1985.Google ScholarCross Ref
- Douglas B. West. Introduction to Graph Theory (2nd Edition). Prentice Hall, August 2000.Google Scholar
- Mihalis Yannakakis and Fanica Gavril. The maximum k-colorable subgraph problem for chordal graphs. Inf. Process. Lett., 24(2):133--137, 1987. Google ScholarDigital Library
Index Terms
- Live-range unsplitting for faster optimal coalescing
Recommendations
Live-range unsplitting for faster optimal coalescing
LCTES '09Register 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 ...
Optimistic coalescing for heterogeneous register architectures
LCTES '07: Proceedings of the 2007 ACM SIGPLAN/SIGBED conference on Languages, compilers, and tools for embedded systemsIn this paper, Optimistic coalescing has been proven as an elegant and effective technique that provides better chances of safely coloring more registers in register allocation than other coalescing techniques. Its algorithm originally assumes ...
Optimistic register coalescing
Graph-coloring register allocators eliminate copies by coalescing the source and target nodes of a copy if they do not interfere in the interference graph. Coalescing, however, can be harmful to the colorability of the graph because it tends to yield a ...
Comments