Skip to main content

To Inline or Not to Inline? Enhanced Inlining Decisions

  • Conference paper
Languages and Compilers for Parallel Computing (LCPC 2003)

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

Abstract

The decision to inline a procedure in the Open Research Compiler (ORC) was based on a temperature heuristics that takes into consideration the time spent in a procedure and the size of the procedure. In this paper we describe the trade-off that has to be worked out to make the correct inlining decisions. We introduce two new heuristics to enhance the ORC inlining heuristics: adaptation and cycle_density. With adaptation we are allowed to vary the temperature threshold and prevent penalizing small benchmarks. With cycle_density we prevent the inlining of procedures that have a high temperature in spite of being called infrequently. Experiments show that while adaptation improves the speedup obtained with inlining across the SPEC2000 suite, cycle_density reduces significantly both the code growth and compilation time increase caused by inlining. We then characterize the SPEC INT2000 benchmarks according to the inlining potential of their function calls. Our enhancement is released in the ORC 2.0.

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. Allen, R., Johnson, S.: Compiling C for vectorization, parallelization, and inline expansion. In: ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pp. 241–249 (1988)

    Google Scholar 

  2. Ayers, A., Gottlieb, R., Schooler, R.: Aggressive inlining. In: ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI) (May 1997)

    Google Scholar 

  3. Bacon, D.F., Sweeney, P.F.: Fast static analysis of C++ virtual function calls. In: Object-Oriented Programming Systems, Languages and Applications (OOPSLA), pp. 324–341 (1996)

    Google Scholar 

  4. Calder, B., Grunwald, D.: Reducing indirect function call overhead in C++ programs. In: ACM SIGPLAN Symposium on Principles of Programming Languages (POPL), Portland, Oregon, pp. 397–408 (1994)

    Google Scholar 

  5. Chang, P.P., Mahlke, S.A., Chen, W.Y., Hwu, W.m.W.: Profile-guided automatic inline expansion for c programs. Software - Practice and Experience 22(5), 349–369 (1992)

    Article  Google Scholar 

  6. Davidson, J.W., Holler, A.M.: A model of subprogram inlining. Technical report, Computer Science Technical Report TR-89-04, Department of Computer Science, University of Virginia (July 1989)

    Google Scholar 

  7. Davidson, J.W., Holler, A.M.: A study of a C function inliner. Software - Practice and Experience (SPE) 18(8), 775–790 (1989)

    Article  Google Scholar 

  8. Davidson, J.W., Holler, A.M.: Subprogram inlining: A study of its effects on program execution time. IEEE Transactions on Software Engineering (TSE) 18(2), 89–102 (1992)

    Article  Google Scholar 

  9. Dean, J., Grove, D., Chambers, C.: Optimization of object-oriented programs using static class hierarchy analysis. In: Olthoff, W. (ed.) ECOOP 1995. LNCS, vol. 952, pp. 77–101. Springer, Heidelberg (1995)

    Google Scholar 

  10. Detlefs, D.L., Agesen, O.: Inlining of virtual methods. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, p. 258. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  11. Garey, M.R., Johnson, D.S.: Computers and Intractability, A Guide to the Theory of NP-Completeness. W.H. Freeman, New York (1979)

    MATH  Google Scholar 

  12. Hazelwood, K., Grove, D.: Adaptive online context-sensitive inlining. In: Internetaional Symposium on Code Generation and Optimization, San Francisco, CA, March 2003, pp. 253–264 (2003)

    Google Scholar 

  13. Hwu, W.W., Chang, P.P.: Inline function expansion for compiling realistic c programs. In: ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI) (1989)

    Google Scholar 

  14. Leupers, R., Marwedel, P.: Function inlining under code size constraints for embedded processors. In: International Conference on Computer-Aided Design (ICCAD) (November 1999)

    Google Scholar 

  15. Scheifler, R.W.: An analysis of inline substitution for a structured programming language. Communications of the ACM 20(9), 647–654 (1977)

    Article  MATH  Google Scholar 

  16. Stephenson, M., Amarasinghe, S., Martin, M., O’Reilly, U.: Meta-optimization: Improving compiler heuristics with machine learning. In: ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pp. 77–90 (2003)

    Google Scholar 

  17. Suganuma, T., Yasue, T., Nakatani, T.: An empirical study of method inlining for a Java just-in-time compiler. In: 2nd Java Virtual Machine Research and Technology Symposium (JVM 2002) (August 2002)

    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

Zhao, P., Amaral, J.N. (2004). To Inline or Not to Inline? Enhanced Inlining Decisions. 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_26

Download citation

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

  • 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