Skip to main content

The Power of Belady’s Algorithm in Register Allocation for Long Basic Blocks

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2958))

Abstract

Optimization techniques such as loop-unrolling and trace-scheduling can result in long straight-line codes. It is, however, unclear how well the register allocation algorithms of current compilers perform on these codes. Compilers may well have been optimized for human written codes, which are likely to have short basic blocks. To evaluate how the state of the art compilers behave on long straight-line codes, we wrote a compiler that implements the simple Belady’s MIN algorithm.

The main contribution of this paper is the evaluation of Belady’s MIN algorithm when used for register allocation for long straight-line codes. These codes were executed on a MIPS R12000 processor. Our results show that applications compiled using Belady’s MIN algorithm run faster than when compiled with the MIPSPro or GCC compiler. In particular, Fast Fourier Transforms (FFTs) of size 32 and 64 run 12% and 33% faster than when compiled using the MIPSPro compiler.

This work was supported by the NSF under grant CCR 01-21401 ITR

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Puschel, M., et al.: SPIRAL: A Generator for Platform-Adapted Libraries of Signal Processing Algorithms. Journal of HPCA (2002)

    Google Scholar 

  2. Xiong, J., Johnson, J., Johnson, R., Padua, D.: SPL: A Language and a Compiler for DSP Algorithms. In: Proc. of PLDI, pp. 298-308 (2001)

    Google Scholar 

  3. Whaley, R., Dongarra, J.: Automatically Tuned Linear Algebra Software. Technical Report UT CS-97-366, University of Tenessee (1997)

    Google Scholar 

  4. Hennessy, J.L., Patterson, D.A.: Computer Architecture: A Quantitative Approach. Morgan Kaufmann Publishers, San Francisco (1996)

    MATH  Google Scholar 

  5. Chaitin, G.: Register Allocation and Spilling Via Graph Coloring. In: Proc. of the SIGPLAN Symp. On Compiler Construction, pp. 98–105 (1982)

    Google Scholar 

  6. Garey, M., Johnson, D.: Computers and Intracdtability: A Guide to the Theory of NP-Completeness. W.H. Freeman and Company, New York (1989)

    Google Scholar 

  7. Bergner, P., Dahl, P., Engebretsen, D., Keefe, O.M.T.: Spill code minimization via interference region spilling. In: SIGPLAN Conf. on PLDI, pp. 287-295 (1997)

    Google Scholar 

  8. Briggs, P., et al.: Improvements to Graph Coloring Register Allocation. ACM Trans. on Programming Languages and Systems 6, 428–455 (1994)

    Article  Google Scholar 

  9. George, L., Appel, L.: Iterated Register Coalescing. ACM Trans. on Programming Languages and Systems 18, 300–324 (1996)

    Article  Google Scholar 

  10. Hsu, W., Fischer, C., Goodman, J.: On the Minimization of Load/Stores in Local Register Allocation. IEEE TSE 15, 1252–1260 (1989)

    Google Scholar 

  11. Horwitz, L., karp, R.M., Miller, R.E., Winograd, S.: Index Register Allocation. Journal of the ACM 13, 43–61 (1966)

    Article  MATH  Google Scholar 

  12. Kennedy, K.: Index Register Allocation in Straight Line Code and Simple Loops. In: Design and Optimization of Compilers. Prentice Hall, Englewood Cliffs (1972)

    Google Scholar 

  13. Luccio, F.: A Comment on Index Register Allocation. CACM 10, 572–574 (1967)

    Article  MATH  Google Scholar 

  14. Belady, L.: A Study of Replacement of Algorithms for a Virtual Storage Computer. IBM Systems Journal 5, 78–101 (1966)

    Article  Google Scholar 

  15. Yotov, K., et al.: A Comparison of Empirical and Model-driven Optimization. In: Proc. of PLDI, pp. 63-76 (2003)

    Google Scholar 

  16. Fischer, C., LeBlanc, T.: Crafting a Compiler. Benjamin Cummings (1987)

    Google Scholar 

  17. Aho, A., Sethi, R., Ullman, J.D.: Compilers, Principles, Techniques, and Tools. Addison-Wesley Publishing Comapny, Reading (1985)

    MATH  Google Scholar 

  18. Goodman, J.R., Hsu, W.C.: Code Scheduling and Register Allocation in Large Basic Blocks. In: Proc. of the 2nd ICS, pp. 442–452. ACM Press, New York (1988)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Guo, J., Garzarán, M.J., Padua, D. (2004). The Power of Belady’s Algorithm in Register Allocation for Long Basic Blocks. In: Rauchwerger, L. (eds) Languages and Compilers for Parallel Computing. LCPC 2003. Lecture Notes in Computer Science, vol 2958. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-24644-2_24

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-24644-2_24

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-21199-0

  • Online ISBN: 978-3-540-24644-2

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics