Advertisement

Design Automation for Embedded Systems

, Volume 13, Issue 1–2, pp 115–137 | Cite as

Optimistic chordal coloring: a coalescing heuristic for SSA form programs

  • Philip Brisk
  • Ajay K. Verma
  • Paolo Ienne
Article

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.

Keywords

Algorithms Performance Coalescing Chordal graphs 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    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 Google Scholar
  2. 2.
    Bouchez F (2005) Register allocation and spill complexity under SSA. MS thesis, Technical Report RR2005-33, ENS-Lyon, Lyon France, August 2005 Google Scholar
  3. 3.
    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 Google Scholar
  4. 4.
    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 Google Scholar
  5. 5.
    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 Google Scholar
  6. 6.
    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 CrossRefGoogle Scholar
  7. 7.
    Briggs P, Cooper KD, Torczon L (1994) Improvements to graph coloring register allocation. ACM Trans Program Lang Syst 16:428–455 CrossRefGoogle Scholar
  8. 8.
    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 CrossRefGoogle Scholar
  9. 9.
    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 Google Scholar
  10. 10.
    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 Google Scholar
  11. 11.
    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 Google Scholar
  12. 12.
    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 Google Scholar
  13. 13.
    Chaitin GJ, Auslander MA, Chandra AK, Cocke J, Hopkins ME, Markstein PW (1981) Register allocation via coloring. Comput Lang 6:47–57 CrossRefGoogle Scholar
  14. 14.
    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 Google Scholar
  15. 15.
    Cooper KD, Torczon L (2003) Engineering a compiler. Morgan Kaufmann, Los Altos (now a subsidiary of Elsevier) zbMATHGoogle Scholar
  16. 16.
    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 CrossRefGoogle Scholar
  17. 17.
    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) Google Scholar
  18. 18.
    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 Google Scholar
  19. 19.
    Farach-Colton M, Liberatore V (2000) On local register allocation. J Algorithms 37:37–65 zbMATHCrossRefMathSciNetGoogle Scholar
  20. 20.
    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 zbMATHCrossRefMathSciNetGoogle Scholar
  21. 21.
    George L, Appel AW (1996) Iterated register coalescing. ACM Trans Program Lang Syst 18:300–324 CrossRefGoogle Scholar
  22. 22.
    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 Google Scholar
  23. 23.
    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 Google Scholar
  24. 24.
    Hack S, Goos G (2006) Register allocation for SSA-form programs in polynomial time. Inf Process Lett 98:150–155 CrossRefMathSciNetGoogle Scholar
  25. 25.
    Hailperin M (2005) Comparing conservative coalescing criteria. ACM Trans Program Lang Syst 27:571–582 CrossRefGoogle Scholar
  26. 26.
    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 Google Scholar
  27. 27.
    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 Google Scholar
  28. 28.
    Kempe AB (1879) The geographical problem of the four colors. Am J Math 2:193–200 CrossRefMathSciNetGoogle Scholar
  29. 29.
    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) MathSciNetGoogle Scholar
  30. 30.
    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 Google Scholar
  31. 31.
    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 Google Scholar
  32. 32.
    Park J, Moon S-M (2004) Optimistic register coalescing. ACM Trans Program Lang Syst 26:735–765 CrossRefGoogle Scholar
  33. 33.
    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 Google Scholar
  34. 34.
    Poletto M, Sarkar V (1999) Linear scan register allocation. ACM Trans Program Lang Syst 21:895–913 CrossRefGoogle Scholar
  35. 35.
    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 Google Scholar
  36. 36.
    Seward HH (1954) Information sorting in the application of electronic digital computers to business operations. MS thesis. Massachusetts Institute of Technology, Cambridge, MA, USA Google Scholar
  37. 37.
    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 Google Scholar
  38. 38.
    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 zbMATHCrossRefMathSciNetGoogle Scholar
  39. 39.
    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 CrossRefGoogle Scholar
  40. 40.
    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 Google Scholar

Copyright information

© Springer Science+Business Media, LLC 2008

Authors and Affiliations

  1. 1.Swiss Federal Institute of TechnologyLausanneSwitzerland

Personalised recommendations