Abstract
Compilation for embedded processors can be either aggressive (time consuming cross-compilation) or just in time (embedded and usually dynamic). The heuristics used in dynamic compilation are highly constrained by limited resources, time and memory in particular. Recent results on the SSA form open promising directions for the design of new register allocation heuristics for embedded systems and especially for embedded compilation. In particular, heuristics based on tree scan with two separated phases -- one for spilling, then one for coloring/coalescing -- seem good candidates for designing memory-friendly, fast, and competitive register allocators. Still, also because of the side effect on power consumption, the minimization of loads and stores overhead (spilling problem) is an important issue. This paper provides an exhaustive study of the complexity of the "spill everywhere" problem in the context of the SSA form. Unfortunately, conversely to our initial hopes, many of the questions we raised lead to NP-completeness results. We identify some polynomial cases but that are impractical in JIT context. Nevertheless, they can give hints to simplify formulations for the design of aggressive allocators.
- Andrew W. Appel and Lal George. Optimal spilling for CISC machines with few registers. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'01), pages 243--253, Snowbird, Utah, USA, June 2001. ACM Press. Google Scholar
Digital Library
- L. A. Belady. A study of replacement algorithms for a virtual storage computer. IBM Systems Journal, 5(2):78--101, 1966.Google Scholar
Digital Library
- C. Berge. Graphs and Hypergraphs. North Holland, 1973. Google Scholar
Digital Library
- Florent Bouchez, Alain Darte, Christophe Guillon, and Fabrice Rastello. Register allocation and spill complexity under SSA. Technical Report RR2005-33, LIP, ENS-Lyon, France, August 2005.Google Scholar
- Florent Bouchez, Alain Darte, Christophe Guillon, and Fabrice Rastello. Register allocation: What does the NP-completeness proof of Chaitin et al. really prove? In International Workshop on Languages and Compilers for Parallel Computing (LCPC'06), LNCS, New Orleans, Louisiana, 2006. Springer Verlag. Google Scholar
Digital Library
- Philip Brisk, Foad Dabiri, Jamie Macbeth, and Majid Sarrafzadeh. Polynomial time graph coloring register allocation. In 14th International Workshop on Logic and Synthesis, June 2005.Google Scholar
- Zoran Budimlić, Keith Cooper, Tim Harvey, Ken Kennedy, Tim Oberg, and Steve Reeves. Fast copy coalescing and live range identification. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'02), pages 25--32, Berlin, Germany, 2002. ACM Press. Google Scholar
Digital Library
- Gregory J. Chaitin, Marc A. Auslander, Ashok K. Chandra, John Cocke, Martin E. Hopkins, and Peter W. Markstein. Register allocation via coloring. Computer Languages, 6:47--57, 1981.Google Scholar
Digital Library
- Keith D. Cooper and Anshuman Dasgupta. Tailoring graph-coloring register allocation for runtime compilation. In International Symposium on Code Generation and Optimization (CGO'06), pages 39--49. IEEE Computer Society, 2006. Google Scholar
Digital Library
- Keith D. Cooper and Linda Torczon. Engineering a Compiler. Morgan Kaufmann, 2004.Google Scholar
- Martin Farach-Colton and Vincenzo Liberatore. On local register allocation. Journal of Algorithms, 37(1):37--65, 2000. Google Scholar
Digital Library
- Michael R. Garey and Davis S. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. W.H. Freeman and Company, 1979. Google Scholar
Digital Library
- Martin Charles Golumbic. Algorithmic Graph Theory and Perfect Graphs. Academic Press, New York, 1980.Google Scholar
Digital Library
- Christian Grothoff, Rajkishore Barik, Rahul Gupta, and Vinayaka Pandit. Optimal bitwise register allocation using integer linear programming. In International Workshop on Languages and Compilers for Parallel Computing (LCPC'06), LNCS, New Orleans, Louisiana, 2006. Springer Verlag. Google Scholar
Digital Library
- Sebastian Hack and Gerhard Goos. Optimal register allocation for SSA-form programs in polynomial time. Information Processing Letters, 98(4):150--155, May 2006. Google Scholar
Digital Library
- Sebastian Hack, Daniel Grund, and Gerhard Goos. Towards register allocation for programs in SSA-form. Technical Report RR2005-27, Universität Karlsruhe, September 2005.Google Scholar
- Sebastian Hack, Daniel Grund, and Gerhard Goos. Register allocation for programs in SSA-form. In International Conference on Compiler Construction (CC'06), volume 3923 of LNCS. Springer Verlag, 2006. Google Scholar
Digital Library
- Guei-Yuan Lueh, Thomas Gross, and Ali-Reza Adl-Tabatabai. Fusion-based register allocation. ACM Transactions on Programming Languages and Systems, 22(3):431--470, 2000. Google Scholar
Digital Library
- Poletto and Sarkar. Linear scan register allocation. ACM Transactions on Programming Languages and Systems, 21(5):895--913, 1999. Google Scholar
Digital Library
- Omri Traub, Glenn H. Holloway, and Michael D. Smith. Quality and speed in linear-scan register allocation. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'98), pages 142--151, 1998. Google Scholar
Digital Library
- Christian Wimmer and Hanspeter Mössenböck. Optimized interval splitting in a linear scan register allocator. In Michael Hind and Jan Vitek, editors, 1st International Conference on Virtual Execution Environments (VEE'05), Chicago, IL, USA, June 2005. ACM. Google Scholar
Digital Library
- Mihalis Yannakakis. Node-and edge-deletion NP-complete problems. In Annual ACM symposium on Theory of computing (STOC'78), pages 253--264, San Diego, CA, USA, 1978. Google Scholar
Digital Library
- Mihalis Yannakakis and Fanica Gavril. The maximum k-colorable subgraph problem for chordal graphs. Information Processing Letters, 24(2):133--137, 1987. Google Scholar
Digital Library
Index Terms
On the complexity of spill everywhere under SSA form
Recommendations
Linear scan register allocation on SSA form
CGO '10: Proceedings of the 8th annual IEEE/ACM international symposium on Code generation and optimizationThe linear scan algorithm for register allocation provides a good register assignment with a low compilation overhead and is thus frequently used for just-in-time compilers. Although most of these compilers use static single assignment (SSA) form, the ...
Studying optimal spilling in the light of SSA
CASES '11: Proceedings of the 14th international conference on Compilers, architectures and synthesis for embedded systemsRecent developments in register allocation, mostly linked to static single assignment (SSA) form, have shown that it is possible to decouple the problem in two successive phases: a first spilling phase places load and store instructions so that the ...
On the complexity of spill everywhere under SSA form
LCTES '07: Proceedings of the 2007 ACM SIGPLAN/SIGBED conference on Languages, compilers, and tools for embedded systemsCompilation for embedded processors can be either aggressive (time consuming cross-compilation) or just in time (embedded and usually dynamic). The heuristics used in dynamic compilation are highly constrained by limited resources, time and memory in ...







Comments