Abstract
Recent research shows that maintaining SSA form allows to split register allocation into separate phases: spilling, register assignment and copy coalescing. After spilling, register assignment can be done in polynomial time, but copy coalescing is NP-complete. In this paper we present an assignment approach with integrated copy coalescing, which maps the problem to the Partitioned Boolean Quadratic Problem (PBQP). Compared to the state-of-the-art recoloring approach, this reduces the relative number of swap and copy instructions for the SPEC CINT2000 benchmark to 99.6% and 95.2%, respectively, while taking 19% less time for assignment and coalescing.
Chapter PDF
Similar content being viewed by others
References
Bouchez, F., Darte, A., Rastello, F.: On the complexity of register coalescing. In: CGO 2007: Proceedings of the International Symposium on Code Generation and Optimization, pp. 102–114 (2007)
Braun, M., Mallon, C., Hack, S.: Preference-guided register assignment. In: Gupta, R. (ed.) CC 2010. LNCS, vol. 6011, pp. 205–223. Springer, Heidelberg (2010)
Briggs, P., Cooper, K.D., Torczon, L.: Improvements to graph coloring register allocation. ACM Trans. Program. Lang. Syst. 16(3), 428–455 (1994)
Brisk, P., Dabiri, F., Macbeth, J., Sarrafzadeh, M.: Polynomial time graph coloring register allocation. In: 14th International Workshop on Logic and Synthesis. ACM Press, New York (2005)
Buchwald, S., Zwinkau, A.: Instruction selection by graph transformation. In: Proceedings of the 2010 International Conference on Compilers, Architectures and Synthesis for Embedded Systems, CASES 2010, pp. 31–40. ACM, New York (2010)
Chaitin, G.J., Auslander, M.A., Chandra, A.K., Cocke, J., Hopkins, M.E., Markstein, P.W.: Register allocation via coloring. Computer Languages 6(1), 47–57 (1981)
Dirac, G.: On rigid circuit graphs. Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg 25, 71–76 (1961)
Ebner, D., Brandner, F., Scholz, B., Krall, A., Wiedermann, P., Kadlec, A.: Generalized instruction selection using SSA-graphs. In: LCTES 2008: Proceedings of the 2008 ACM SIGPLAN-SIGBED Conference on Languages, Compilers, and Tools for Embedded Systems, pp. 31–40. ACM, New York (2008)
Eckstein, E., König, O., Scholz, B.: Code instruction selection based on SSA-graphs. In: Anshelevich, E. (ed.) SCOPES 2003. LNCS, vol. 2826, pp. 49–65. Springer, Heidelberg (2003)
Grund, D., Hack, S.: A fast cutting-plane algorithm for optimal coalescing. In: Adsul, B., Vetta, A. (eds.) CC 2007. LNCS, vol. 4420, pp. 111–125. Springer, Heidelberg (2007)
Hack, S.: Register allocation for programs in SSA form. Ph.D. thesis, Universität Karlsruhe (October 2007)
Hack, S., Goos, G.: Copy coalescing by graph recoloring. In: PLDI 2008: Proceedings of the 2008 ACM SIGPLAN Conference on Programming Language Design and Implementation (2008)
Hack, S., Grund, D., Goos, G.: Register allocation for programs in SSA-form. In: Mycroft, A., Zeller, A. (eds.) CC 2006. LNCS, vol. 3923, pp. 247–262. Springer, Heidelberg (2006)
Hames, L., Scholz, B.: Nearly optimal register allocation with PBQP. In: Lightfoot, D.E., Ren, X.-M. (eds.) JMLC 2006. LNCS, vol. 4228, pp. 346–361. Springer, Heidelberg (2006)
Nethercote, N., Seward, J.: Valgrind: a framework for heavyweight dynamic binary instrumentation. SIGPLAN Not. 42(6), 89–100 (2007)
Scholz, B., Eckstein, E.: Register allocation for irregular architectures. In: LCTES-SCOPES, pp. 139–148 (2002)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2011 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Buchwald, S., Zwinkau, A., Bersch, T. (2011). SSA-Based Register Allocation with PBQP. In: Knoop, J. (eds) Compiler Construction. CC 2011. Lecture Notes in Computer Science, vol 6601. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-19861-8_4
Download citation
DOI: https://doi.org/10.1007/978-3-642-19861-8_4
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-19860-1
Online ISBN: 978-3-642-19861-8
eBook Packages: Computer ScienceComputer Science (R0)