Skip to main content

A Framework for Efficient Register Allocation through Selective Register Demotion

  • Conference paper
  • First Online:
Languages, Compilers, and Run-Time Systems for Scalable Computers (LCR 2000)

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

  • 269 Accesses

Abstract

Decisions made during register allocation greatly influence the overall quality of compiled code. Standard graph-coloring allocators often make spilling decisions which are not guided by program structure or path-sensitive control flow information. This can result in generation and placement of load and store instructions which is inefficient from a global perspective. Quite often, allocation decisions get heavily influ- enced by the choice of candidates for register residency. We propose a framework which selectively demotes variables in a contained manner to maintain balanced register pressure. The decisions for selective demotion are made through a flow-analytic approach and the loads and stores are inserted in strategic points such that degrading effect of spill code on overall code quality is sufficiently reduced. Our approach tries to keep variables as candidates for register allocation only along the paths where it is profitable to do so. We attempt to identify good local candidates for demotion, however, decisions are taken only after their global demo- tion costs are captured. We have implemented the framework inside the SGI MIPSPRO compiler and have obtained very encouraging results in improving the allocation of a Briggs-style allocator.

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

Access this chapter

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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman. Compilers Priciples, Techniques, and Tools. Addison-Wesley Publishing Company, 1986.

    Google Scholar 

  2. P. Bergner, P. Dahl, D. Engebretsen, and M. O’Keefe. Spill Code Minimization via Interference Region Spilling. In Proceedings of the 1997 ACM SIGPLAN Con-ference on Programming Languages Design and Implementation, pages 287–295, June 1997.

    Google Scholar 

  3. P. Briggs, K. Cooper, and L. Torczon. Improvements to Graph Coloring Reg-ister Allocation. ACM Transactions on Programming Languages and Systems, 16(3):428–455, May 1994.

    Article  Google Scholar 

  4. D. Callahan and B. Koblenz. Register Allocation via Hierarchical Graph Coloring. In Proceedings of the 1991 ACM SIGPLAN Conference on Programming Languages Design and Implementation, pages 192–203, June 1991.

    Google Scholar 

  5. G. Chaitin, M. Auslander, A. Chandra, J. Cocke, M. Hopkins, and P. Markstein. Register Allocation via Coloring. Computer Languages, 6:47–57, January 1981.

    Google Scholar 

  6. F. Chow and J. Hennessy. The Priority-based Coloring Approach to Register Al-location. ACM Transactions on Programming Languages and Systems, 12(4):501–536, October 1990.

    Article  Google Scholar 

  7. P. Kolte and M. J. Harrold. Load/store Range Analysis for Global Register Allocation. In Proceedings of the 1993 ACM SIGPLAN Conference on Programming Languages Design and Implementation, pages 268–277, June 1993.

    Google Scholar 

  8. R. Lo, F. Chow, R. Kennedy, S. Liu, and P. Tu. Register Promotion by Sparse Partial Redundancy Elimination of Loads and Stores. In Proceedings of the 1998 ACM SIGPLAN Conference on Programming Languages Design and Implementa-tion, pages 26–37, May 1998.

    Google Scholar 

  9. Guei-Yuan Lueh. Fusion-based register allocation. PhD Thesis CMU-CS-97-135, Carnegie Mellon University, 1997.

    Google Scholar 

  10. S. Mantripragada, S. Jain, and J. Dehnert. A New Framework for Integrated Global Local Scheduling. In Proceedings of the 1998 International Conference on Parallel Architectures and Compilation Techniques, pages 167–175, October 1998.

    Google Scholar 

  11. C. Norris and L. L. Pollock. RAP: A PDG-based Register Allocator. Software-Practice and Experience, 28(4):401–424, April 1998.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2000 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Bairagi, D., Pande, S., Agrawal, D.P. (2000). A Framework for Efficient Register Allocation through Selective Register Demotion. In: Dwarkadas, S. (eds) Languages, Compilers, and Run-Time Systems for Scalable Computers. LCR 2000. Lecture Notes in Computer Science, vol 1915. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-40889-4_5

Download citation

  • DOI: https://doi.org/10.1007/3-540-40889-4_5

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-41185-7

  • Online ISBN: 978-3-540-40889-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics