Revisiting Graph Coloring Register Allocation: A Study of the Chaitin-Briggs and Callahan-Koblenz Algorithms
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.
KeywordsGraph Coloring Physical Register Register Copy Tile Tree Register Allocation
Unable to display preview. Download preview PDF.
- 1.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)Google Scholar
- 2.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)Google Scholar
- 3.Briggs, P.: Register Allocation via Graph Coloring. Technical Report TR92- 183, Rice University, 24 (1992)Google Scholar
- 7.Chaitin, G.J.: Register Allocation and Spilling via Graph Coloring. In: SIGPLAN 1982 (1982)Google Scholar
- 9.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)Google Scholar
- 11.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)Google Scholar
- 12.Knobe, K., Zadeck, K.: Register Allocation Using Control Trees. Technical Report CS-92-13, Brown University, Department of Computer Science (March 1992)Google Scholar
- 14.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)Google Scholar
- 17.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)Google Scholar
- 19.Wu, Q.: Register Allocation via Hierarchical Graph Coloring. Master’s thesis, Michigan Technological University (1996)Google Scholar