Abstract
As register allocation is one of the most important phases in optimizing compilers, much work has been done to improve its quality and speed. We present a novel register allocation architecture for programs in SSA-form which simplifies register allocation significantly. We investigate certain properties of SSA-programs and their interference graphs, showing that they belong to the class of chordal graphs. This leads to a quadratic-time optimal coloring algorithm and allows for decoupling the tasks of coloring, spilling and coalescing completely. After presenting heuristic methods for spilling and coalescing, we compare our coalescing heuristic to an optimal method based on integer linear programming.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Chaitin, G.J., Auslander, M.A., Chandra, A.K., Cocke, J., Hopkins, M.E., Markstein, P.W.: Register allocation via graph coloring. Journal of Computer Languages 6, 45–57 (1981)
Briggs, P., Cooper, K.D., Torczon, L.: Improvements to graph coloring register allocation. ACM Trans. Program. Lang. Syst. 16, 428–455 (1994)
Golumbic, M.C.: Algorithmic Graph Theory And Perfect Graphs. Academic Press, London (1980)
Budimlić, Z., Cooper, K.D., Harvey, T.J., Kennedy, K., Oberg, T.S., Reeves, S.W.: Fast copy coalescing and live-range identification. In: Proceedings of the ACM SIGPLAN 2002 Conference on Programming language design and implementation, pp. 25–32. ACM Press, New York (2002)
Bouchez, F.: Allocation de registres et vidage en mémoire. Master’s thesis, ÉNS Lyon (2005)
Diestel, R.: Graph Theory, Graduate Texts in Mathematics, 3rd edn., vol. 173. Springer, Heidelberg (2005)
Bergner, P., Dahl, P., Engebretsen, D., O’Keefe, M.: Spill code minimization via interference region spilling. In: PLDI 1997: Proceedings of the ACM SIGPLAN 1997 conference on Programming language design and implementation, pp. 287–295. ACM Press, New York (1997)
Chow, F.C., Hennessy, J.L.: The priority-based coloring approach to register allocation. ACM Trans. Program. Lang. Syst. 12, 501–536 (1990)
Hsu, W.C., Fisher, C.N., Goodman, J.R.: On the Minimization of Loads/Stores in Local Register Allocation. IEEE Trans. Softw. Eng. 15, 1252–1260 (1989)
Guo, J., Garzaran, M.J., Padua, D.: The Power of Belady’s Algorithm in Register Allocation for Long Basic Blocks. In: Rauchwerger, L. (ed.) LCPC 2003. LNCS, vol. 2958. Springer, Heidelberg (2004)
Belady, L.: A Study of Replacement of Algorithms for a Virtual Storage Computer. IBM Systems Journal 5, 78–101 (1966)
Cytron, R., Ferrante, J., Rosen, B.K., Wegman, M.N., Zadek, F.K.: Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems 13, 451–490 (1991)
Briggs, P., Cooper, K.D., Harvey, T.J., Simpson, L.T.: Practical Improvements to the Construction and Destruction of Static Single Assignment Form. Software: Practice and Experience 28, 859–881 (1998)
Hack, S., Grund, D., Goos, G.: Towards Register Allocation for Programs in SSA-form. Technical Report 2005-27, Universität Karlsruhe (2005)
Lindenmaier, G., Beck, M., Boesler, B., Geiß, R.: Firm, an intermediate language for compiler research. Technical Report 2005-8, University of Karlsruhe (2005)
George, L., Appel, A.W.: Iterated register coalescing. ACM Trans. Program. Lang. Syst. 18, 300–324 (1996)
Park, J., Moon, S.M.: Optimistic register coalescing. ACM Trans. Program. Lang. Syst. 26, 735–765 (2004)
Andersson, C.: Register Allocation by Optimal Graph Coloring. In: Hedin, G. (ed.) CC 2003. LNCS, vol. 2622, pp. 33–45. Springer, Heidelberg (2003)
Pereira, F.M.Q., Palsberg, J.: Register allocation via coloring of chordal graphs. In: Yi, K. (ed.) APLAS 2005. LNCS, vol. 3780, pp. 315–329. Springer, Heidelberg (2005)
Hack, S.: Interference Graphs of Programs in SSA-form. Technical Report 2005-15, Universität Karlsruhe (2005)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Hack, S., Grund, D., Goos, G. (2006). Register Allocation for Programs in SSA-Form. In: Mycroft, A., Zeller, A. (eds) Compiler Construction. CC 2006. Lecture Notes in Computer Science, vol 3923. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11688839_20
Download citation
DOI: https://doi.org/10.1007/11688839_20
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-33050-9
Online ISBN: 978-3-540-33051-6
eBook Packages: Computer ScienceComputer Science (R0)