Techniques and Trade-Offs in Function Inlining Optimization
DOI:
https://doi.org/10.4108/eetsis.4453Keywords:
Function inlining, Compliler optimization, function call, program performance, compiler pipelineAbstract
Function inlining is a critical optimization technique used by compilers to improve program performance by replacing a function call with the body of the function and eliminating the overhead associated with function calls. However, the decision of when to inline functions and when not to is a nontrivial problem due to interactions with the rest of the compiler pipeline. Incorrect inlining decisions can cause runtime performance degradation, making this problem a crucial one to study. This paper reviews the different techniques used to optimize function inlining, including simple textual substitution, profile-guided inlining, interprocedural optimization, partial inlining, speculative inlining, and advanced techniques such as indirect call optimizations. Each technique has its strengths, weaknesses, and trade-offs, and ongoing research is exploring ways to overcome these challenges. Optimizing function inlining is a complex problem, and different techniques offer different tradeoffs. Further research to improve the performance of function inlining while minimizing any potential drawbacks could be pursued based on this paper.
References
IBM Support, https://www.ibm.com/support/pages/whatdoesit-mean-inline-function-and-how-does-itaffect-program, last accessed 2023/03/03.
Wikipedia, https://en.wikipedia.org/wiki/Interprocedural_optimization, last. accessed 2023/03/10.
Rajiv, G., Eduard, M., Youtao, Z.: Profile guided compiler optimizations. The Compiler Design Handbook: Optimizations & Machine Code Generation. CRC Press (2002).
YouTube Home, https://www.gnu.org/software/gawk/manual/In direct-Calls. Last accessed 2023/03/10.
Leupers, R., Marwedel, P.: Function inlining under code size constraints for embedded processors. In: IEEE/ACM International Conference on Computer-Aided Design. Digest of Technical Papers (Cat. No. 99CH37051), pp. 253-256. (1999).
SPEC CPU® 2006, https://www.spec.org/cpu2006/. last accessed 2023/03/10.
Google AI Blog Denton, Tom, http://www.ai.googleblog.com/. last accessed 2023/03/10.
Agarwal, R., Srikant, Y.N.: Inlining of library functions using profiling information. In: ACM SIGPLAN Notices, 41(6) (2006).
Gao, L., Chen, Q., Su, Z.: A study on function inlining optimization. In: Proceedings of the 3rd International Conference on Computer Science and Information Technology, (2010).
Lee, H., Lee, J. W., Kim, C.: An indirect call optimization for dynamic languages. In: Proceedings of the 2009 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 390-399, (2009).
Zhao, J., Chen, X., Chen, H.: Combining Profile-guided Inlining and Partial Inlining for Performance Optimization. In: IEEE Transactions on Parallel and Distributed Systems, 31(10), pp. 2368-2379, (2020).
Kulkarni, P., Choudhary, A.: Machine Learning-based function inlining in LLVM. In: Proceedings of the 4th International Workshop on Software Engineering for Parallel Systems, pp. 23-29, (2018).
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2023 Priya Gupta, Aditya Jha, Brinda Gupta, Kime Sumpi, Sabyasachi Sahoo, Mukkoti Maruthi Venkata Chalapathi
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
This is an open access article distributed under the terms of the CC BY-NC-SA 4.0, which permits copying, redistributing, remixing, transformation, and building upon the material in any medium so long as the original work is properly cited.