Abstract
In this paper, we extend past work on Linear Scan register allocation, and propose two Extended Linear Scan (ELS) algorithms that retain the compile-time efficiency of past Linear Scan algorithms while delivering performance that can match or surpass that of Graph Coloring. Specifically, this paper makes the following contributions:
– We highlight three fundamental theoretical limitations in using Graph Coloring as a foundation for global register allocation, and introduce a basic Extended Linear Scan algorithm, ELS 0, which addresses all three limitations for the problem of Spill-Free Register Allocation.
– We introduce the ELS 1 algorithm which extends ELS 0 to obtain a greedy algorithm for the problem of Register Allocation with Total Spills.
– Finally, we present experimental results to compare the Graph Coloring and Extended Linear Scan algorithms. Our results show that the compile-time speedups for ELS 1 relative to GC were significant, and varied from 15× to 68×. In addition, the resulting execution time improved by up to 5.8%, with an average improvement of 2.3%.
Together, these results show that Extended Linear Scan is promising as an alternate foundation for global register allocation, compared to Graph Coloring, due to its compile-time scalability without loss of execution time performance.
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
Bradlee, D.G., Eggers, S.J., Henry, R.R.: Integrating register allocation and instruction scheduling for riscs. In: ASPLOS-IV, pp. 122–131 (1991)
Briggs, P.: Register Allocation via Graph Coloring. PhD thesis, Rice University (April 1992)
Budimlic, Z., et al.: Fast copy coalescing and live-range identification. In: PLDI ’02: Proceedings of the ACM SIGPLAN 2002 Conference on Programming language design and implementation, pp. 25–32 (2002)
Callahan, D., Koblenz, B.: Register allocation via hierarchical graph coloring. In: PLDI ’91: Proceedings of the ACM SIGPLAN 1991 conference on Programming language design and implementation, pp. 192–203 (1991)
Chaitin, G.J.: Register allocation and spilling via graph coloring. In: ACM SIGPLAN ’82 Symposium on Compiler Construction, June 1982, pp. 98–105 (1982)
Chow, F., Hennessy, J.: Register allocation by priority-based coloring. In: Proceedings of the 1984 SIGPLAN symposium on Compiler construction, pp. 222–232 (1984)
George, L., Appel, A.W.: Iterated register coalescing. ACM Transactions on Programming Languages and Systems 18(3), 300–324 (1996)
Makarov, V.N.: Yet another gcc register allocator. In: Proceedings of the GCC Developers Summit, May 2005, pp. 148–157 (2005)
Motwani, R., et al.: Combining register allocation and instruction scheduling. Technical Report STAN-CS-TN-95-22, Department of Computer Science, Stanford University (1995)
Muchnick, S.: Advanced Compiler Design and Implementation. Morgan Kaufmann, San Francisco (1997)
Norris, C., Pollock, L.L.: An experimental study of several cooperative register allocation and instruction scheduling strategies. In: MICRO 28, pp. 169–179 (1995)
Park, J., Moon, S.-M.: Optimistic register coalescing. In: International Conference on Parallel Architectures and Compilation Techniques, October 1998, pp. 196–204 (1998)
Pinter, S.S.: Register allocation with instruction scheduling. In: PLDI ’93: Proceedings of the ACM SIGPLAN 1993 conference on Programming language design and implementation, pp. 248–257 (1993)
Poletto, M., Sarkar, V.: Linear scan register allocation. ACM Transactions on Programming Languages and Systems 21(5), 895–913 (1999)
Standard Performance Evaluation Corporation (SPEC) (2006), http://www.spec.org/cpu2000/issues/
Traub, O., Holloway, G.H., Smith, M.D.: Quality and speed in linear-scan register allocation. In: SIGPLAN Conference on Programming Language Design and Implementation, pp. 142–151 (1998)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2007 Springer Berlin Heidelberg
About this paper
Cite this paper
Sarkar, V., Barik, R. (2007). Extended Linear Scan: An Alternate Foundation for Global Register Allocation. In: Krishnamurthi, S., Odersky, M. (eds) Compiler Construction. CC 2007. Lecture Notes in Computer Science, vol 4420. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-71229-9_10
Download citation
DOI: https://doi.org/10.1007/978-3-540-71229-9_10
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-71228-2
Online ISBN: 978-3-540-71229-9
eBook Packages: Computer ScienceComputer Science (R0)