Abstract
Graph coloring algorithms have been shown to be an efficient and effective means of performing register allocation. The power of these algorithms lies in their strong coloring heuristics and their ability to abstract away disparate allocation problems such as data-flow constraints, conforming to calling conventions, and target machine restrictions. However, even optimal algorithms cannot color every graph, and often some live ranges must be spilled to memory to make room for others. In this paper, we present a new approach of reducing spill code, which can be used to complement virtually any register allocation algorithm, and provides a good support to implement cheaper spill methods like spilling to another register (from a different class) and rematerialization (reloading the register from a constant or expression). This algorithm was partially implemented into the Metrowerks StarCore C compiler where it has proven its efficiency in terms of both cycle count and code size.
Article PDF
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.Avoid common mistakes on your manuscript.
REFERENCES
SC140 DSP Core Reference Manual, http://e-www.motorola.com/.les/dsp/doc/ref_manual/MNSC140CORE.pdf.
G. J. Chaitin, Register Allocation and Spilling via Graph Coloring. SIGPLAN Notices, Proc. ACM SIGPLAN 1982 Symposium on Compiler Construction, 17(6), pp. 98–105 (June 1982).
D. Bernstein, D. Q. Goldin, M. C. Golumbic, H. Krawczyk, Y. Mansour, I. Nahshon, and R. Y. Pinter, Spill Code Minimization Techniques for Optimizing Compilers. SIGPLAN Notices, Proc. ACM SIGPLAN 1989 Conference on Programming Language Design and Implementation, 24(7), pp. 258–263 (July 1989).
P. E. Bergner, Spill Code Minimization Techniques for Graph Coloring Register Allocators. PhD thesis, University of Minnesota (1997).
D. Callahan, B. Koblenz, Register Allocation via Hierarchical Graph Coloring. Proc. ACM SIGPLAN 1991 Conference on Programming Language Design and Implementation, Toronto, Ontario, Canada (June 26–28, 1991).
C. Click and K. D. Cooper, Combining Analyses, Combining Optimizations. ACM Transactions on Programming Languages and Systems, 17(2):181–196 (1995).
S. Muchnick, Advanced Compiler Design and Implementation, Morgan Kauufmann Publishers (1997).
R. A. Huff, Lifetime-Sensitive Modulo Scheduling, SIGPLAN Conference on Programming Language Design and Implementation (1993).
J. Llosa, A. Gonzalez, E. Ayguade, and M. Valero, Swing Modulo Scheduling: A Lifetime Sensitive Approach, International Conference on Parallel Architectures and Compilation Techniques (October 1996).
F. W. Chow and J. L. Hennesy, The Priority-Based Coloring Approach to Register Allocation, ACM Trans. Program. Languages Syst., 12(4):501–536 (October 1990).
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Palanciuc, V., Badea, D. A Spill Code Minimization Technique—Application in the Metrowerks StarCore C Compiler. International Journal of Parallel Programming 32, 475–499 (2004). https://doi.org/10.1023/B:IJPP.0000042083.16504.5e
Issue Date:
DOI: https://doi.org/10.1023/B:IJPP.0000042083.16504.5e