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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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)
Ayers, A., Gottlieb, R., Schooler, R.: Aggressive inlining. In: ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI) (May 1997)
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)
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)
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)
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)
Davidson, J.W., Holler, A.M.: A study of a C function inliner. Software - Practice and Experience (SPE) 18(8), 775–790 (1989)
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)
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)
Detlefs, D.L., Agesen, O.: Inlining of virtual methods. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, p. 258. Springer, Heidelberg (1999)
Garey, M.R., Johnson, D.S.: Computers and Intractability, A Guide to the Theory of NP-Completeness. W.H. Freeman, New York (1979)
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)
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)
Leupers, R., Marwedel, P.: Function inlining under code size constraints for embedded processors. In: International Conference on Computer-Aided Design (ICCAD) (November 1999)
Scheifler, R.W.: An analysis of inline substitution for a structured programming language. Communications of the ACM 20(9), 647–654 (1977)
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)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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