Extended Linear Scan: An Alternate Foundation for Global Register Allocation

  • Vivek Sarkar
  • Rajkishore Barik
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4420)

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, ELS0, which addresses all three limitations for the problem of Spill-Free Register Allocation.

– We introduce the ELS1 algorithm which extends ELS0 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 ELS1 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.

References

  1. 1.
    Bradlee, D.G., Eggers, S.J., Henry, R.R.: Integrating register allocation and instruction scheduling for riscs. In: ASPLOS-IV, pp. 122–131 (1991)Google Scholar
  2. 2.
    Briggs, P.: Register Allocation via Graph Coloring. PhD thesis, Rice University (April 1992)Google Scholar
  3. 3.
    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)Google Scholar
  4. 4.
    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)Google Scholar
  5. 5.
    Chaitin, G.J.: Register allocation and spilling via graph coloring. In: ACM SIGPLAN ’82 Symposium on Compiler Construction, June 1982, pp. 98–105 (1982)Google Scholar
  6. 6.
    Chow, F., Hennessy, J.: Register allocation by priority-based coloring. In: Proceedings of the 1984 SIGPLAN symposium on Compiler construction, pp. 222–232 (1984)Google Scholar
  7. 7.
    George, L., Appel, A.W.: Iterated register coalescing. ACM Transactions on Programming Languages and Systems 18(3), 300–324 (1996)CrossRefGoogle Scholar
  8. 8.
    Makarov, V.N.: Yet another gcc register allocator. In: Proceedings of the GCC Developers Summit, May 2005, pp. 148–157 (2005)Google Scholar
  9. 9.
    Motwani, R., et al.: Combining register allocation and instruction scheduling. Technical Report STAN-CS-TN-95-22, Department of Computer Science, Stanford University (1995)Google Scholar
  10. 10.
    Muchnick, S.: Advanced Compiler Design and Implementation. Morgan Kaufmann, San Francisco (1997)Google Scholar
  11. 11.
    Norris, C., Pollock, L.L.: An experimental study of several cooperative register allocation and instruction scheduling strategies. In: MICRO 28, pp. 169–179 (1995)Google Scholar
  12. 12.
    Park, J., Moon, S.-M.: Optimistic register coalescing. In: International Conference on Parallel Architectures and Compilation Techniques, October 1998, pp. 196–204 (1998)Google Scholar
  13. 13.
    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)Google Scholar
  14. 14.
    Poletto, M., Sarkar, V.: Linear scan register allocation. ACM Transactions on Programming Languages and Systems 21(5), 895–913 (1999)CrossRefGoogle Scholar
  15. 15.
    Standard Performance Evaluation Corporation (SPEC) (2006), http://www.spec.org/cpu2000/issues/
  16. 16.
    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)Google Scholar

Copyright information

© Springer Berlin Heidelberg 2007

Authors and Affiliations

  • Vivek Sarkar
    • 1
  • Rajkishore Barik
    • 2
  1. 1.IBM T.J. Watson Research Center 
  2. 2.IBM India Research Laboratory 

Personalised recommendations