Abstract
Techniques for global register allocation via graph coloring have been extensively studied and widely implemented in compiler frameworks. This paper examines a particular variant – the Callahan Koblenz allocator – and compares it to the Chaitin-Briggs graph coloring register allocator. Both algorithms were published in the 1990’s, yet the academic literature does not contain an assessment of the Callahan-Koblenz allocator. This paper evaluates and contrasts the allocation decisions made by both algorithms. In particular, we focus on two key differences between the allocators:
Spill code: The Callahan-Koblenz allocator attempts to minimize the effect of spill code by using program structure to guide allocation and spill code placement. We evaluate the impact of this strategy on allocated code.
Copy elimination: Effective register-to-register copy removal is important for producing good code. The allocators use different techniques to eliminate these copies. We compare the mechanisms and provide insights into the relative performance of the contrasting techniques.
The Callahan-Koblenz allocator may potentially insert extra branches as part of the allocation process. We also measure the performance overhead due to these branches.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Bergner, P., Dahl, P., Engebretsen, D., O’Keefe, M.T.: Spill Code Minimization via Interference Region Spilling. In: SIGPLAN Conference on Programming Language Design and Implementation, pp. 287–295 (1997)
Bernstein, D., Goldin, D.Q., Golumbic, M.C., Krawczyk, H., Mansour, Y., Nahshon, I., Pinter, R.Y.: Spill Code Minimization Techniques for Optimizing Compilers. In: SIGPLAN Conference on Programming Language Design and Implementation, pp. 258–263 (1989)
Briggs, P.: Register Allocation via Graph Coloring. Technical Report TR92- 183, Rice University, 24 (1992)
Briggs, P., Cooper, K.D., Harvey, T.J., Taylor Simpson, L.: Practical Improvements to the Construction and Destruction of Static Single Assignment. Form. Software - Practice and Experience 28(8), 859–881 (1998)
Briggs, P., Cooper, K.D., Torczon, L.: Improvements to Graph Coloring Register Allocation. ACM Transactions on Programming Languages and Systems 16(3), 428–455 (1994)
Callahan, D., Koblenz, B.: Register Allocation via Hierarchical Graph Coloring. SIGPLAN 26(6), 192–203 (1991)
Chaitin, G.J.: Register Allocation and Spilling via Graph Coloring. In: SIGPLAN 1982 (1982)
Chaitin, G.J., Auslander, M.A., Chandra, A.K., Cocke, J., Hopkins, M.E., Markstein, P.W.: Register Allocation via Coloring. Computer Languages 6, 45–57 (1981)
Cooper, K.D., Simpson, L.T.: Live range Splitting in a Graph Coloring Register Allocator. In: Proceedings of the International Compiler Construction Conference (March 1998)
George, L., Appel, A.W.: Iterated register coalescing. ACM Trans. Program. Lang. Syst. 18(3), 300–324 (1996)
Kim, S., Moon, S.-M., Park, J., Ebciolu, K.: Unroll-based register coalescing. In: ICS 2000: Proceedings of the 14th international conference on supercomputing. ACM Press, New York (2000)
Knobe, K., Zadeck, K.: Register Allocation Using Control Trees. Technical Report CS-92-13, Brown University, Department of Computer Science (March 1992)
Koseki, A., Komatsu, H., Nakatani, T.: Preference-directed graph coloring. In: Proceedings of the ACM SIGPLAN 2002 Conference on Programming language design and implementation, pp. 33–44. ACM Press, New York (2002)
Lattner, C., Adve, V.: LLVM: A Compilation Framework for Lifelong Program Analysis and Transformation. In: Proceedings of the 2004 International Symposium on Code Generation and Optimization (CGO 2004) (March 2004)
Geoffrey Lowney, P., Freudenberger, S.M., Karzes, T.J., Lichtenstein, W.D., Nix, R.P., O’Donnell, J.S., Ruttenberg, J.C.: The Multiflow Trace Scheduling Compiler. The Journal of Supercomputing 7(1-2), 51–142 (1993)
Lueh, G.-Y., Gross, T., Adl-Tabatabai, A.-R.: Fusion-based register allocation. ACM Transactions on Programming Languages and Systems 22(3), 431–470 (2000)
Norris, C., Pollock, L.L.: Register Allocation over the Program Dependence Graph. In: SIGPLAN Conference on Programming Language Design and Implementation, pp. 266–277 (1994)
Sethi, R.: Complete Register Allocation Problems. In: Proceedings of the fifth annual ACM symposium on Theory of computing, pp. 182–195. ACM, New York (1973)
Wu, Q.: Register Allocation via Hierarchical Graph Coloring. Master’s thesis, Michigan Technological University (1996)
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
Cooper, K.D., Dasgupta, A., Eckhardt, J. (2006). Revisiting Graph Coloring Register Allocation: A Study of the Chaitin-Briggs and Callahan-Koblenz Algorithms. In: Ayguadé, E., Baumgartner, G., Ramanujam, J., Sadayappan, P. (eds) Languages and Compilers for Parallel Computing. LCPC 2005. Lecture Notes in Computer Science, vol 4339. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-69330-7_1
Download citation
DOI: https://doi.org/10.1007/978-3-540-69330-7_1
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-69329-1
Online ISBN: 978-3-540-69330-7
eBook Packages: Computer ScienceComputer Science (R0)