[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.1109/CGO.2007.26acmconferencesArticle/Chapter ViewAbstractPublication PagescgoConference Proceedingsconference-collections
Article

On the Complexity of Register Coalescing

Published: 11 March 2007 Publication History

Abstract

Memory transfers are becoming more important to optimize, for both performance and power consumption. With this goal in mind, new register allocation schemes are developed, which revisit not only the spilling problem but also the coalescing problem. Indeed, a more aggressive strategy to avoid load/store instructions may increase the constraints to suppress (coalesce) move instructions. This paper is devoted to the complexity of the coalescing phase, in particular in the light of recent developments on the SSA form. We distinguish several optimizations that occur in coalescing heuristics: a) aggressive coalescing removes as many moves as possible, regardless of the colorability of the resulting interference graph; b) conservative coalescing removes as many moves as possible while keeping the colorability of the graph; c) incremental conservative coalescing removes one particular move while keeping the colorability of the graph; d) optimistic coalescing coalesces moves aggressively, then gives up about as few moves as possible so that the graph becomes colorable again. We almost completely classify the NP-completeness of these problems, discussing also on the structure of the interference graph: arbitrary, chordal, or k-colorable in a greedy fashion. We believe that such a study is a necessary step for designing new coalescing strategies.

References

[1]
{1} A. Appel. Modern Compiler Implementation in ML. Cambridge University Press, 1998.
[2]
{2} A. Appel and L. George. Coalescing challenge. http:// www.cs.princeton.edu/~appel/coalesce, 2000.
[3]
{3} A. W. Appel and L. George. Optimal spilling for CISC machines with few registers. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'01), pages 243-253, Snowbird, Utah, United States, June 2001. ACM Press.
[4]
{4} F. Bouchez, A. Darte, C. Guillon, and F. Rastello. Register allocation and spill complexity under SSA. Technical Report RR2005-33, LIP, ENS-Lyon, France, Aug. 2005.
[5]
{5} F. Bouchez, A. Darte, C. Guillon, and F. Rastello. Register allocation: What does the NP-completeness proof of Chaitin et al. really prove? In WDDD 2006, Fifth Annual Workshop on Duplicating, Deconstructing, and Debunking, part of ISCA-33, Boston, MA, June 2006.
[6]
{6} P. Briggs. Register allocation via graph coloring. PhD Thesis Rice COMP TR92-183, Department of Computer Science, Rice University, 1992.
[7]
{7} P. Briggs, K. Cooper, and L. Torczon. Improvements to graph coloring register allocation. ACM Transactions on Programming Languages and Systems, 16(3):428-455, May 1994.
[8]
{8} P. Briggs, K. D. Cooper, T. J. Harvey, and L. T. Simpson. Practical improvements to the construction and destruction of static single assignment form. Software: Practice and Experience, 28(8):859-881, 1998.
[9]
{9} P. Brisk, F. Dabiri, J. Macbeth, and M. Sarrafzadeh. Polynomial time graph coloring register allocation. In 14th International Workshop on Logic and Synthesis, June 2005.
[10]
{10} Z. Budimlic, K. Cooper, T. Harvey, K. Kennedy, T. Oberg, and S. Reeves. Fast copy coalescing and live range identification. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'02), pages 25-32, Berlin, Germany, 2002. ACM Press.
[11]
{11} G. Chaitin, M. Auslander, A. Chandra, J. Cocke, M. Hopkins, and P. Markstein. Register allocation via coloring. Computer Languages, 6:47-57, January 1981.
[12]
{12} G. J. Chaitin. Register allocation & spilling via graph coloring. In Proceedings of the 1982 ACM SIGPLAN Symposium on Compiler Construction, volume 17(6) of SIGPLAN Notices , pages 98-105, 1982.
[13]
{13} K. D. Cooper and L. T. Simpson. Live range splitting in a graph coloring register allocator. In Compiler Construction, volume 1383 of Lecture Notes in Computer Science, pages 174-187. Springer Verlag, 1998.
[14]
{14} T. H. Cormen, C. E. Leiserson, and R. L. Rivest. Introduction to Algorithms. The MIT Press and McGraw-Hill Book Company, 1989.
[15]
{15} R. Cytron and J. Ferrante. What's in a name? Or the value of renaming for parallelism detection and storage allocation. In Proceedings of the 1987 International Conference on Parallel Processing, pages 19-27. IEEE Computer Society Press, Aug. 1987.
[16]
{16} R. Cytron, J. Ferrante, B. Rosen, M. Wegman, and K. Zadeck. Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems, 13(4): 451-490, 1991.
[17]
{17} R. Cytron and R. Gershbein. Efficient accommodation of may-alias information in SSA form. In PLDI'93: Proceedings of the ACM SIGPLAN 1993 conference on Programming language design and implementation, pages 36-45, New York, NY, USA, 1993. ACM Press.
[18]
{18} E. Dahlhaus, D. S. Johnson, C. H. Papadimitriou, P. D. Seymour, and M. Yannakakis. The complexity of multiway cuts. In 24th Annual ACM STOC, pages 241-251, Victoria, Canada, 1992. ACM Press.
[19]
{19} M. R. Garey and D. S. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman and Company, 1979.
[20]
{20} M. R. Garey, D. S. Johnson, and L. Stockmeyer. Some simplified NP-complete graph problems. Theoretical Computer Science, 1:237-267, 1976.
[21]
{21} L. George and A. W. Appel. Iterated register coalescing. ACM Transactions on Programming Languages and Systems , 18(3):300-324, May 1996.
[22]
{22} M. C. Golumbic. Algorithmic Graph Theory and Perfect Graphs. Academic Press, New York, 1980.
[23]
{23} S. Hack, D. Grund, and G. Goos. Towards register allocation for programs in SSA-form. Technical Report RR2005-27, Universität Karlsruhe, Sept. 2005.
[24]
{24} S. Hack, D. Grund, and G. Goos. Register allocation for programs in SSA-form. In Compiler Construction 2006, volume 3923 of LNCS. Springer Verlag, 2006.
[25]
{25} T. R. Jensen and B. Toft. Graph Coloring Problems. Wiley-Interscience Series in Discrete Mathematics and Optimization. John Wiley & Sons, Inc., 1995.
[26]
{26} A. Leung and L. George. Static single assignment form for machine code. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'99), pages 204-214. ACM Press, 1999.
[27]
{27} V. Liberatore, M. Farach-Colton, and U. Kremer. Evaluation of algorithms for local register allocation. In 8th International Conference on Compiler Construction, volume 1575 of Lecture Notes in Computer Science, pages 137-152, Amsterdam, The Netherlands, Mar. 1999. Springer Verlag.
[28]
{28} G.-Y. Lueh, T. Gross, and A.-R. Adl-Tabatabai. Fusion-based register allocation. ACM Transactions on Programming Languages and Systems, 22(3):431-470, 2000.
[29]
{29} J. Park and S.-M. Moon. Optimistic register coalescing. In Proceedings of the International Conference on Parallel Architecture and Compilation Techniques (PACT'98), pages 196-204. IEEE Press, 1998.
[30]
{30} J. Park and S.-M. Moon. Optimistic register coalescing. ACM Transactions on Programming Languages and Systems (ACM TOPLAS), 26(4), 2004.
[31]
{31} F. M. Q. Pereira and J. Palsberg. Register allocation via coloring of chordal graphs. In Proceedings of APLAS'05, Asian Symposium on Programming Languages and Systems, pages 315-329, Tsukuba, Japan, Nov. 2005.
[32]
{32} F. M. Q. Pereira and J. Palsberg. Register allocation after classical SSA elimination is NP-complete. In Proceedings of FOSSACS'06, Foundations of Software Science and Computation Structures, Vienna, Austria, Mar. 2006.
[33]
{33} F. Rastello, F. de Ferrière, and C. Guillon. Optimizing the translation out-of-SSA with renaming constraints. Technical Report RR2005-34, LIP, ENS Lyon, France, august 2005.
[34]
{34} F. Rastello, F. de Ferrière, and C. Guillon. Optimizing translation out of SSA using renaming constraints. In Proceedings of the International Symposium on Code Generation and Optimization (CGO'04), pages 265-278. IEEE Computer Society, 2004.
[35]
{35} V. C. Sreedhar, R. D. Ju, D. M. Gillies, and V. Santhanam. Translating out of static single assignment form. In A. Cortesi and G. Filé, editors, Proceedings of the 6th international Symposium on Static Analysis, volume 1694 of Lecturem Notes in Computer Science, pages 194-210. Springer Verlag, 1999.
[36]
{36} S. R. Vegdahl. Using node merging to enhance graph coloring. In Proceedings of the ACM SIGPLAN conference on Programming language design and implementation (PLDI'99), pages 150-154, New York, NY, USA, 1999. ACM Press.
[37]
{37} H. Yang, W. Hu, R. Qiao, and Z. Zhang. Approaches to enhance graph coloring register allocation. In Proceedings of 1998 International Symposium for Future Software Technology (ISFST'98), 1998.

Cited By

View all
  • (2019)IGC: the open source Intel graphics compilerProceedings of the 2019 IEEE/ACM International Symposium on Code Generation and Optimization10.5555/3314872.3314902(254-265)Online publication date: 16-Feb-2019
  • (2017)Trace Register Allocation PoliciesProceedings of the 14th International Conference on Managed Languages and Runtimes10.1145/3132190.3132209(92-104)Online publication date: 27-Sep-2017
  • (2015)Studying Optimal Spilling in the Light of SSAACM Transactions on Architecture and Code Optimization10.1145/268539211:4(1-26)Online publication date: 9-Jan-2015
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
CGO '07: Proceedings of the International Symposium on Code Generation and Optimization
March 2007
346 pages
ISBN:0769527647

Sponsors

Publisher

IEEE Computer Society

United States

Publication History

Published: 11 March 2007

Check for updates

Qualifiers

  • Article

Conference

CGO07

Acceptance Rates

CGO '07 Paper Acceptance Rate 27 of 84 submissions, 32%;
Overall Acceptance Rate 312 of 1,061 submissions, 29%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)2
  • Downloads (Last 6 weeks)0
Reflects downloads up to 13 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2019)IGC: the open source Intel graphics compilerProceedings of the 2019 IEEE/ACM International Symposium on Code Generation and Optimization10.5555/3314872.3314902(254-265)Online publication date: 16-Feb-2019
  • (2017)Trace Register Allocation PoliciesProceedings of the 14th International Conference on Managed Languages and Runtimes10.1145/3132190.3132209(92-104)Online publication date: 27-Sep-2017
  • (2015)Studying Optimal Spilling in the Light of SSAACM Transactions on Architecture and Code Optimization10.1145/268539211:4(1-26)Online publication date: 9-Jan-2015
  • (2013)Hardware acceleration for programs in SSA formProceedings of the 2013 International Conference on Compilers, Architectures and Synthesis for Embedded Systems10.5555/2555729.2555743(1-10)Online publication date: 29-Sep-2013
  • (2013)A decoupled non-SSA global register allocation using bipartite liveness graphsACM Transactions on Architecture and Code Optimization10.1145/254410110:4(1-24)Online publication date: 1-Dec-2013
  • (2013)Improved bitwidth-aware variable packingACM Transactions on Architecture and Code Optimization10.1145/2509420.250942710:3(1-22)Online publication date: 16-Sep-2013
  • (2013)A decoupled local memory allocatorACM Transactions on Architecture and Code Optimization10.1145/2400682.24006939:4(1-22)Online publication date: 20-Jan-2013
  • (2013)A polynomial spilling heuristicProceedings of the 2013 IEEE/ACM International Symposium on Code Generation and Optimization (CGO)10.1109/CGO.2013.6495005(1-10)Online publication date: 23-Feb-2013
  • (2013)Elimination of parallel copies using code motion on data dependence graphsComputer Languages, Systems and Structures10.1016/j.cl.2012.09.00139:1(25-47)Online publication date: 1-Apr-2013
  • (2013)Optimal register allocation in polynomial timeProceedings of the 22nd international conference on Compiler Construction10.1007/978-3-642-37051-9_1(1-20)Online publication date: 16-Mar-2013
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media