Skip to main content

Fine-Grain Register Allocation Based on a Global Spill Costs Analysis

  • Conference paper
Software and Compilers for Embedded Systems (SCOPES 2003)

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

Included in the following conference series:

Abstract

A graph-coloring approach is widely used for register allocation, but its efficiency is limited because its formulation is too abstracted to use information about program context. This paper proposes a new register allocation technique that improves the efficiency by using information about the flow of variable references of a program. In the new approach, register allocation is performed at every reference of a variable in the order of the variable reference flow. For each reference, the costs of various possible register allocations are estimated by tracing a possible instruction sequence resulting from register allocations. A cost model is formulated to reduce the scope of the trace. Experimental results show that the proposed approach reduces spill code by an average of 34.3% and 17.8% in 8 benchmarks when compared to the Briggs’ allocator and the interference region spilling allocator, respectively.

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. Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley Publishing Company, Reading Mass (1986)

    Google Scholar 

  2. Advanced RISC Machines Ltd: ARM Architecture Reference Manual. Document Number: ARM DDI 0100B, Advanced RISC Machines Ltd., (ARM) (1996)

    Google Scholar 

  3. Bergner, P., Dahl, P., Engebretsen, D., O’Keefe, M.: Spill code minimization via interference region spilling. In: Proceedings of the ACM PLDI 1997, June 1997, pp. 287–295 (1997)

    Google Scholar 

  4. Briggs, P., Cooper, K.D., Torczon, L.: Rematerialization. In: Proceedings of the ACM SIGPLAN 1992 Conference on Programming Language Design and Implementation, SIGPLAN Notices, June 1992, vol. 27(7), pp. 311–321 (1992)

    Google Scholar 

  5. Briggs, P., Cooper, K.D., Kennedy, K., Torczon, L.: Coloring heuristics for register allocation. In: Proceedings of the ACM SIGPLAN 1989 Conference on Programming Language Design and Implementation, SIGPLAN Notices, June 1989, vol. 24(6), pp. 275–284 (1989)

    Google Scholar 

  6. Chaitin, G.J.: Register allocation and spilling via coloring. In: Proceedings of the ACM SIGPLAN 1982 Symposium on Compiler Construction, SIGPLAN Notices, June 1982, vol. 17(6), pp. 98–105 (1982)

    Google Scholar 

  7. Chaitin, G.J., Auslander, M.A., Chandra, A.K., Cocke, J., Hopkins, M., Markstein, P.W.: Register allocation via coloring. Computer Languages 6, 47–57 (1981)

    Article  Google Scholar 

  8. Fraser, C.W., Hanson, D.R.: A Retargetable C Compiler: Design and Implementation. Benjamin/Cummings, Redwood City CA (1995)

    MATH  Google Scholar 

  9. Farach, M., Liberatore, V.: On local register allocation. In: Proceedings of the 9th Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 564-573 (1998)

    Google Scholar 

  10. Goodwin, D.W., Wilken, K.D.: Optimal and near-optimal global register allocation using 0-1 integer programming. Software-Practice and Experience 26(8), 929–965 (1996)

    Article  Google Scholar 

  11. Hsu, W.-C., Fischer, C.N., Goodman, J.R.: On the minimization of loads/stores in local register allocation. IEEE Transactions on Software Engineering 15(10), 1252–1260 (1989)

    Article  Google Scholar 

  12. Kim, D.H.: Advanced compiler optimization for CalmRISC8 low-end embedded processor. In: Watt, D.A. (ed.) CC 2000. LNCS, vol. 1781, pp. 173–188. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  13. Kolte, P., Harrold, M.J.: Load/store range analysis for global register allocation. In: Proceedings of the ACM PLDI 1993, June 1993, pp. 268–277 (1993)

    Google Scholar 

  14. Mushnick, S.S.: Advanced compiler design and implementation. Morgan Kaufmann, SanFrancisco (1997)

    Google Scholar 

  15. Proebsting, T.A., Fischer, C.N.: Demand-driven register allocation. ACM Transactions on Programming Languages and Systems 18(6), 683–710 (1996)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2003 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Kim, DH., Lee, HJ. (2003). Fine-Grain Register Allocation Based on a Global Spill Costs Analysis. In: Krall, A. (eds) Software and Compilers for Embedded Systems. SCOPES 2003. Lecture Notes in Computer Science, vol 2826. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-39920-9_18

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-39920-9_18

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-20145-8

  • Online ISBN: 978-3-540-39920-9

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics