Advertisement

Aggressive Function Inlining: Preventing Loop Blockings in the Instruction Cache

  • Yosi Ben Asher
  • Omer Boehm
  • Daniel Citron
  • Gadi Haber
  • Moshe Klausner
  • Roy Levin
  • Yousef Shajrawi
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4917)

Abstract

Aggressive function inlining can lead to significant improvements in execution time. This potential is reduced by extensive instruction cache (Icache) misses caused by subsequent code expansion. It is very difficult to predict which inlinings cause Icache conflicts, as the exact location of code in the executable depends on completing the inlining first. In this work we propose a new method for selective inlining called “Icache Loop Blockings” (ILB). In ILB we only allow inlinings that do not create multiple inlined copies of the same function in hot execution cycles. This prevents any increase in the Icache footprint. This method is significantly more aggressive than previous ones, experiments show it is also better.

Results on a server level processor and on an embedded CPU, running SPEC CINT2000, show an improvement of 10% in the execution time of the ILB scheme in comparison to other inlining methods. This was achieved without bloating the size of the hot code executed at any single point of execution, which is crucial for the embedded processor domain.

We have also considered the synergy between code reordering and inlining focusing on how inlining can help code reordering. This aspect of inlining has not been studied in previous works.

Keywords

Basic Block Call Graph Instruction Cache Call Site Cyclic Path 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Arnold, M., Fink, S., Sarkar, V., Sweeney, P.: A Comparative Study of Static and Profile-based Heuristics for Inlining. In: Proceedings of the ACM SIGPLAN Workshop on Dynamic and Adaptive Compilation and Optimization, pp. 52–64 (2000)Google Scholar
  2. 2.
    Aydin, H., Kaeli, D.: Using Cache Line Coloring to Perform Aggressive Procedure Inlining. SIGARCH Computer Architecture News 28(1), 62–71 (2000)CrossRefGoogle Scholar
  3. 3.
    Ayers, A., Gottlieb, R., Schooler, R.: Aggressive Inlining. In: Proceedings of the 1997 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 134–145 (June 1997)Google Scholar
  4. 4.
    Ball, J.E.: Program improvement by the selective integration of procedure calls. Technical report, PhD thesis, University of Rochester (1982)Google Scholar
  5. 5.
    Das, D.: Function Inlining versus Function Cloning. ACM SIGPLAN Notices 38(6), 23–29 (2003)CrossRefGoogle Scholar
  6. 6.
    Eades, P., Lin, X., Smyth, W.F.: A fast and effective heuristic for the feedback arc set problem. Info. Proc. Letters 47, 319–323 (1993)MATHCrossRefMathSciNetGoogle Scholar
  7. 7.
    Haber, G., Klausner, M., Eisenberg, V., Mendelson, B., Gurevich, M.: Optimization Opportunities Created by Global Data Reordering. In: CGO 2003. First International Symposium on Code Generation and Optimization (March 2003)Google Scholar
  8. 8.
    Kaser, O., Ramakrishnan, C.R.: Evaluating inlining techniques. Computer Languages 24(2), 55–72 (1998)MATHCrossRefGoogle Scholar
  9. 9.
    McFarling, S.: Procedure merging with instruction caches. In: Proceedings of the SIGPLAN Conference on Programming Language Design and Implementation, pp. 71–79 (June 1991)Google Scholar
  10. 10.
    Muth, R., Debray, S., Watterson, S.: ALTO: A Link-Time Optimizer for the Compaq Alpha. Technical Report 98-14, Dept. of Computer Science, The University of Arizona (December 1998)Google Scholar
  11. 11.
    Nahshon, I., Bernstein, D.: FDPR - A Post-Pass Object Code Optimization Tool (April 1996)Google Scholar
  12. 12.
    Scheifler, R.W.: An analysis of inline substitution for a structured programming language. Communications of the ACM 20(9), 647–654 (1977)MATHCrossRefGoogle Scholar
  13. 13.
    Schwarz, B., Debray, S., Andrews, G., Legendre, M.: PLTO: A Link-Time Optimizer for the Intel IA-32 Architecture. In: Proceedings of Workshop on Binary Rewriting (September 2001)Google Scholar
  14. 14.
    Way, T., Breech, B., Du, W., Stoyanov, V., Pollock, L.: Using path-pectra-based cloning in regional-based optimization for instruction level parallelism. In: Proceedings of the 14th International Conference on Parallel and Distributed Computing Systems, pp. 83–90 (2001)Google Scholar
  15. 15.
    Way, T., Pollock, L.: Evaluation of a Region-based Partial Inlining Algorithm for an ILP Optimizing Compiler. In: IASTED International Conference on Parallel and Distributed Computing and Systems (November 2002)Google Scholar
  16. 16.
    Zhao, P., Amaral, J.N.: To inline or not to inline? enhanced inlining decisions (2003)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Yosi Ben Asher
    • 1
  • Omer Boehm
    • 1
  • Daniel Citron
    • 1
  • Gadi Haber
    • 1
  • Moshe Klausner
    • 1
  • Roy Levin
    • 1
  • Yousef Shajrawi
    • 1
  1. 1.IBM Research Lab in Haifa, Israel, Computer Science Department Haifa University, HaifaIsrael

Personalised recommendations