Abstract
This paper describes a global progressive register allocator, a register allocator that uses an expressive model of the register allocation problem to quickly find a good allocation and then progressively find better allocations until a provably optimal solution is found or a preset time limit is reached. The key contributions of this paper are an expressive model of global register allocation based on multicommodity network flows that explicitly represents spill code optimization, register preferences, copy insertion, and constant rematerialization; two fast, but effective, heuristic allocators based on this model; and a more elaborate progressive allocator that uses Lagrangian relaxation to compute the optimality of its allocations. Our progressive allocator demonstrates code size improvements as large as 16.75% compared to a traditional graph allocator. On average, we observe an initial improvement of 3.47%, which increases progressively to 6.84% as more time is permitted for compilation.
- R. K. Ahuja, T. L. Magnanti, and J. B. Orlin. Network Flows: Theory, Algorithms, and Applications. Prentice-Hall, Inc., 1993. Google Scholar
Digital Library
- A.W. Appel and L. George. Optimal spilling for CISC machines with few registers. In Proc. of the ACM/SIGPLAN Conf. on Prog. Lang. Design and Impl., pp. 243--253. ACM Press, 2001. Google Scholar
Digital Library
- B. M. Baker and J. Sheasby. Accelerating the convergence of subgradient optimisation. European Journal of Operational Research, 117(1):136--144, August 1999.Google Scholar
Cross Ref
- L. A. Belady. A study of replacement algorithms for virtual-storage computer. IBM Systems Journal, 5(2):78--101, 1966.Google Scholar
Digital Library
- P. Bergner, P. Dahl, D. Engebretsen, and M. T. O'Keefe. Spill code minimization via interference region spilling. In ACM/SIGPLAN Conf. on Prog. Lang. Design and Impl., pp. 287--295, 1997. Google Scholar
Digital Library
- D. Bernstein, M. Golumbic, Y. Mansour, R. Pinter, D. Goldin, H. Krawczyk, and I. Nahshon. Spill code minimization techniques for optimizing compilers. In Proc. of the ACM/SIGPLAN Conf. on Prog. Lang. Design and Impl., pp. 258--263. ACM Press, 1989. Google Scholar
Digital Library
- H. Bodlaender, J. Gustedt, and J. A. Telle. Linear-time register allocation for a fixed number of registers. In Proc. of the ACMSIAM Symposium on Discrete Algorithms, pp. 574--583. Society for Industrial and Applied Mathematics, 1998. Google Scholar
Digital Library
- P. Briggs. Register allocation via graph coloring. PhD thesis, Rice University, Houston, TX, USA, 1992. Google Scholar
Digital Library
- P. Briggs, K. D. Cooper, and L. Torczon. Coloring register pairs. ACM Lett. Program. Lang. Syst., 1(1):3--13, 1992. Google Scholar
Digital Library
- P. Briggs, K. D. Cooper, and L. Torczon. Improvements to graph coloring register allocation. ACM Trans. Program. Lang. Syst., 16(3):428--455, 1994. Google Scholar
Digital Library
- D. Callahan and B. Koblenz. Register allocation via hierarchical graph coloring. In Proc. of theACM/SIGPLAN Conf. on Prog. Lang. Design and Impl., pp. 192--203. ACM Press, 1991. Google Scholar
Digital Library
- G. J. Chaitin. Register allocation & spilling via graph coloring. In Proc. of the SIGPLAN symposium on Compiler Construction, pp. 98--101. ACM Press, 1982. Google Scholar
Digital Library
- F. Chow and J. Hennessy. Register allocation by priority-based coloring. In Proc. of the SIGPLAN symposium on Compiler Construction, pp. 222--232, 1984. ACM Press. Google Scholar
Digital Library
- K. Cooper, A. Dasgupta, and J. Eckhardt. Revisiting graph coloring register allocation: A study of the Chaitin-Briggs and Callahan-Koblenz algorithms. In Proc. of the Workshop on Languages and Compilers for Parallel Computing (LCPC'05), October 2005. Google Scholar
Digital Library
- K. D. Cooper and L. T. Simpson. Live range splitting in a graph coloring register allocator. In Proc. of the 1998 Intl. Compiler Construction Conference, 1998. Google Scholar
Digital Library
- M. Farach and V. Liberatore. On local register allocation. In Proc. of the ACM-SIAM Symposium on Discrete Algorithms, 1998. Google Scholar
Digital Library
- C. Fu, K.Wilken, and D. Goodwin. A faster optimal register allocator. The Journal of Instruction-Level Parallelism, 7:1--31, January 2005.Google Scholar
- C. H. Gebotys. Low energy memory and register allocation using network flow. In Proc. of the 34th conference on Design Automation, pp. 435--440. ACM Press, 1997. Google Scholar
Digital Library
- L. George and A. W. Appel. Iterated register coalescing. ACM Trans. Program. Lang. Syst., 18(3):300--324, 1996. Google Scholar
Digital Library
- U. Hirnschrott, A. Krall, and B. Scholz. Graph coloring vs. optimal register allocation for optimizing compilers. In JMLC, pp. 202--213, 2003.Google Scholar
Cross Ref
- W. Hsu, C. N. Fisher, and J. R. Goodman. On the minimization of loads/stores in local register allocation. IEEE Trans. Softw. Eng., 15(10):1252--1260, 1989. Google Scholar
Digital Library
- ILOG CPLEX. http://www.ilog.com/products/cplex.Google Scholar
- K. Kennedy. Design and optimization of compilers, Index register allocation in straight line code and simple loops, pp. 51--63. Prentice- Hall, 1972.Google Scholar
- D. Koes and S. C. Goldstein. A progressive register allocator for irregular architectures. In Proc. of the Intl. Symposium on Code Generation and Optimization, pp. 269--280, Washington, DC, 2005. IEEE Computer Society. Google Scholar
Digital Library
- D. Koes and S. C. Goldstein. An analysis of graph coloring register allocation. Technical Report CMU-CS-06-111, Carnegie Mellon University, March 2006.Google Scholar
- D. J. Kolson, A. Nicolau, N. Dutt, and K. Kennedy. Optimal register assignment to loops for embedded code generation. ACM Transactions on Design Automation of Electronic Systems., 1(2):251--279, 1996. Google Scholar
Digital Library
- T. Kong and K. D. Wilken. Precise register allocation for irregular architectures. In Proc. of the ACM/IEEE Intl. Symposium on Microarchitecture, pp. 297--307. IEEE Computer Society Press, 1998. Google Scholar
Digital Library
- A. Koseki, H. Komatsu, and T. Nakatani. Preference-directed graph coloring. SIGPLAN Not., 37(5):33--44, 2002. Google Scholar
Digital Library
- C. Lemaréchal. Computational Combinatorial Optimization: Optimal or Provably Near-Optimal Solutions, volume 2241 of Lecture Notes in Computer Science, chapter Lagrangian Relaxation, pp. 112--156. Springer-Verlag Heidelberg, 2001. Google Scholar
Digital Library
- V. Liberatore, M. Farach-Colton, and U. Kremer. Evaluation of algorithms for local register allocation. In Proc. of the Intl. Compiler Construction Conference, volume 1575 of Lecture Notes in Computer Science. Springer, 1999. Google Scholar
Digital Library
- F. Luccio. A comment on index register allocation. Commun. ACM, 10(9):572--574, 1967. Google Scholar
Digital Library
- G. Lueh, T. Gross, and A. Adl-Tabatabai. Fusion-based register allocation. ACM Trans. Program. Lang. Syst., 22(3):431--470, 2000. Google Scholar
Digital Library
- A. R. Madabushi. Lagrangian relaxation / dual approaches for solving large-scale linear programming problems. Master's thesis, Virginia Polytechnic Institute and State University, February 1997.Google Scholar
- W. M. Meleis and E. S. Davidson. Optimal local register allocation for a multiple-issue machine. In Proc. of the 8th Intl. Conf. on Supercomputing, pp. 107--116. ACM Press, 1994. Google Scholar
Digital Library
- R. Motwani, K. V. Palem, V. Sarkar, and S. Reyen. Combining register allocation and instruction scheduling. Technical report, Stanford University, Stanford, CA, 1995. Google Scholar
Digital Library
- M. Naik and J. Palsberg. Compiling with code-size constraints. In Proc. of the conference on Languages, Compilers and Tools for Embedded Systems, pp. 120--129. ACM Press, 2002. Google Scholar
Digital Library
- M. Ogawa, Z. Hu, and I. Sasano. Iterative-free program analysis. In Proc. of Intl. Conference on Functional Programming, pp. 111--123. ACM Press, 2003. Google Scholar
Digital Library
- M. Poletto and V. Sarkar. Linear scan register allocation. ACM Trans. Program. Lang. Syst., 21(5):895--913, 1999. Google Scholar
Digital Library
- J. Ruttenberg, G. R. Gao, A. Stoutchinin, and W. Lichtenstein. Software pipelining showdown: optimal vs. heuristic methods in a production compiler. In Proc. of ACM/SIGPLAN Conf. on Prog. Lang. Design and Impl., pp. 1--11, 1996. ACM Press. Google Scholar
Digital Library
- M. D. Smith, N. Ramsey, and G. Holloway. A generalized algorithm for graph-coloring register allocation. SIGPLAN Not., 39(6):277--288, 2004. Google Scholar
Digital Library
- M. Thorup. All structured programs have small tree width and good register allocation. Inf. Comput., 142(2):159--181, 1998. Google Scholar
Digital Library
- O. Traub, G. Holloway, and M. D. Smith. Quality and speed in linear-scan register allocation. In Proc. of the ACM/SIGPLAN Conf. on Prog. Lang. Design and Impl., pp. 142--151, 1998. ACM Press. Google Scholar
Digital Library
- C. Wimmer and H. Mössenböck. Optimized interval splitting in a linear scan register allocator. In Proc. of ACM/USENIX Intl. Conf. on Virtual Execution Environments, pp. 132--141, 2005. ACM Press. Google Scholar
Digital Library
Index Terms
A global progressive register allocator
Recommendations
A global progressive register allocator
PLDI '06: Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and ImplementationThis paper describes a global progressive register allocator, a register allocator that uses an expressive model of the register allocation problem to quickly find a good allocation and then progressively find better allocations until a provably optimal ...
A Progressive Register Allocator for Irregular Architectures
CGO '05: Proceedings of the international symposium on Code generation and optimizationRegister allocation is one of the most important optimizations a compiler performs. Conventional graph-coloring based register allocators are fast and do well on regular, RISC-like, architectures, but perform poorly on irregular, CISC-like, ...







Comments