Abstract
The interference graph for a procedure in Static Single Assignment (SSA) Form is chordal. Since the k-colorability problem can be solved in polynomial-time for chordal graphs, this result has generated interest in SSA-based heuristics for spilling and coalescing. Since copies can be folded during SSA construction, instances of the coalescing problem under SSA have fewer affinities than traditional methods. This paper presents Optimistic Chordal Coloring (OCC), a coalescing heuristic for chordal graphs. OCC was evaluated on interference graphs from embedded/multimedia benchmarks: in all cases, OCC found the optimal solution, and ran, on average, 2.30× faster than Iterated Register Coalescing.
Similar content being viewed by others
References
Boissinot B, Hack S, Grund D, De Dinechin BD, Rastello F (2008) Fast liveness checking for SSA-form programs. In: Proceedings of the 2008 IEEE/ACM symposium on code generation and optimization, Boston, MA, USA, 6–9 April 2008
Bouchez F (2005) Register allocation and spill complexity under SSA. MS thesis, Technical Report RR2005-33, ENS-Lyon, Lyon France, August 2005
Bouchez F, Darte A, Guillon C, Rastello F (2006) Register allocation: what does the NP-Completeness proof of Chaitin et al. really prove? Or revisiting register allocation: why and how? In: Proceedings of the 19th international workshop on languages and compilers for parallel computing, New Orleans, LA, USA, November 2006
Bouchez F, Darte A, Rastello F (2007) On the complexity of register coalescing. In: Proceedings of the international symposium on code generation and optimization, San Jose, CA, USA, March 2008, pp 102–114
Bouchez F, Darte A, Rastello F (2007) On the complexity of spill everywhere under SSA form. In: Proceedings of the ACM SIGPLAN/SIGBED conference on languages, compilers, and tools for embedded systems, San Diego, CA, USA, June 2007, pp 103–112
Briggs P, Cooper KD, Harvey TJ, Simpson LT (1998) Practical improvements to the construction and destruction of static single assignment form. Softw Pract Exp 28:859–881
Briggs P, Cooper KD, Torczon L (1994) Improvements to graph coloring register allocation. ACM Trans Program Lang Syst 16:428–455
Brisk P, Dabiri F, Jafari R, Sarrafzadeh M (2006) Optimal register sharing for high-level synthesis of SSA form programs. IEEE Trans Comput-Aided Des Integr Circuits Syst 25:772–779
Brisk P, Sarrafzadeh M (2007) Interference graphs for procedures in static single information form are interval graphs. In: Proceedings of the 10th international workshop on software and compilers for embedded systems, Nice, France, 20 April 2007, pp 101–110
Brisk P, Verma AK, Ienne P (2007) An optimistic and conservative register assignment heuristic for chordal graphs. In: Proceedings of the international conference on compilers, architecture, and synthesis for embedded systems, Salzburg, Austria, 30 September–3 October 2007, pp 209–217
Budimlic Z, Cooper KD, Harvey TJ, Kennedy K, Oberg TS, Reeves SW (2002) Fast copy coalescing and live range identification. In: Proceedings of the ACM SIGPLAN conference on programming language design and implementation, Berlin, Germany, 17–19 June 2002, pp 25–32
Chaitin GJ (1982) Register allocation and spilling via graph coloring. In: Proceedings of the 1982 SIGPLAN symposium on compiler construction, Boston, MA, USA, 23–25 June 1982, pp 98–105
Chaitin GJ, Auslander MA, Chandra AK, Cocke J, Hopkins ME, Markstein PW (1981) Register allocation via coloring. Comput Lang 6:47–57
Choi J-D, Cytron R, Ferrante J (1991) Automatic construction of sparse data flow evaluation graphs. In: Proceedings of the 18th ACM SIGPLAN/SIGACT symposium on principles of programming languages, Orlando, FL, USA, 21–23 January 1991, pp 55–66
Cooper KD, Torczon L (2003) Engineering a compiler. Morgan Kaufmann, Los Altos (now a subsidiary of Elsevier)
Cytron R, Ferrante J, Rosen BK, Wegman MN, Zadeck FK (1991) Efficiently computing static single assignment form and the control dependence graph. ACM Trans Program Lang Syst 13:451–490
Ershov AP (1962) Reduction of the problem of memory allocation in programming to the problem of coloring the vertices of graphs. Dokl Akad Nauk SSSR 142. English translation in Sov Math 3:163–165 (1962)
Fabri J (1979) Automatic storage optimization. In: Proceedings of the ACM SIGPLAN symposium on compiler construction, Denver, CO, USA, 6–10 August 1979, pp 83–91
Farach-Colton M, Liberatore V (2000) On local register allocation. J Algorithms 37:37–65
Gavril F (1972) Algorithms for minimum coloring, maximum clique, minimum covering by cliques, and maximum independent set of a chordal graph. SIAM J Comput 1:180–187
George L, Appel AW (1996) Iterated register coalescing. ACM Trans Program Lang Syst 18:300–324
Grund D, Hack S (2007) A fast cutting-plane algorithm for optimal coalescing. In: 16th international conference on compiler construction, Braga, Portugal, 26–30 March 2007, pp 111–125
Guthaus MR, Ringenberg JS, Ernst D, Austin TM, Mudge T, Brown RB (2001) MiBench: a free, commercially representative embedded benchmark suite. In: Proceedings of the 4th IEEE workshop on workload characterization, Austin TX, USA, 2 December 2001, pp 3–14
Hack S, Goos G (2006) Register allocation for SSA-form programs in polynomial time. Inf Process Lett 98:150–155
Hailperin M (2005) Comparing conservative coalescing criteria. ACM Trans Program Lang Syst 27:571–582
Hashimoto A, Stevens J (1971) Wire routing by optimizing channel assignment within large apertures. In: Proceedings of the 8th workshop on design automation, Atlantic City, NJ, USA, 28–30 June 1971, pp 155–169
Kaluskar V (2003) An aggressive live range splitting and coalescing framework for efficient register allocation. MS thesis, Georgia Institute of Technology, Atlanta, GA, USA, December 2003
Kempe AB (1879) The geographical problem of the four colors. Am J Math 2:193–200
Lavrov SS (1961) Store economy in closed operator schemes. J Comput Math Math Phys 1:678–701. English translation in USSR Comput Math Math Phys 3:810–828 (1962)
Lee C, Potkonjak M, Mangione-Smith WH (1997) MediaBench: a tool for evaluating and synthesizing multimedia and communications systems. In: Proceedings of the 30th international symposium on microarchitecture, Research Triangle Park, NC, USA, 1–3 December 1997, pp 330–335
Lee JK, Palsberg J, Pereira FMQ (2007) Aliased register allocation for straight-line programs is NP-Complete. In: Proceedings of the 34th international colloquium on automata, languages, and programming, Wroclaw, Poland, 9–13 July 2007, pp 680–691
Park J, Moon S-M (2004) Optimistic register coalescing. ACM Trans Program Lang Syst 26:735–765
Pereira FMQ, Palsberg J (2006) Register allocation after classical SSA elimination is NP-Complete. In: Proceedings of the 9th international conference on foundations of software science and computation structures, Vienna, Austria, 25–31 March 2006, pp 79–83
Poletto M, Sarkar V (1999) Linear scan register allocation. ACM Trans Program Lang Syst 21:895–913
Rastello F, De Ferriere F, Guillon C (2004) Optimizing translation out of SSA using renaming constraints. In: Proceedings of the 2nd IEEE/ACM symposium on code generation and optimization, San Jose, CA, USA, 20–24 March 2004, pp 265–278
Seward HH (1954) Information sorting in the application of electronic digital computers to business operations. MS thesis. Massachusetts Institute of Technology, Cambridge, MA, USA
Sreedhar VC, Ju RD-C, Gillies DM, Santhanam V (1999) Translating out of static single assignment form. In: Proceedings of the 6th international symposium on static analysis, 22–24 September 1999, pp 194–210
Tarjan RE, Yannakakis M (1984) Simple linear time algorithms to test chordality of graphs, test acyclicity of hypergraphs, and selectively reduce acylic hypergraphs. SIAM J Comput 13:566–579
Tseng C-J, Siewiorek DP (1986) Automated synthesis of data paths in digital systems. IEEE Trans Comput-Aided Des Integr Circuits Syst 5:379–395
Vegdahl SR (1999) Using node merging to enhance graph coloring. In: Proceedings of the ACM SIGPLAN conference on programming language design and implementation, Atlanta, GA, USA, 1–4 May 1999, pp 150–154
Author information
Authors and Affiliations
Corresponding author
Additional information
This paper is an extension of a paper that appeared at CASES 2007 [10].
Rights and permissions
About this article
Cite this article
Brisk, P., Verma, A.K. & Ienne, P. Optimistic chordal coloring: a coalescing heuristic for SSA form programs. Des Autom Embed Syst 13, 115–137 (2009). https://doi.org/10.1007/s10617-008-9034-y
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10617-008-9034-y