Abstract
Existing research understates the benefits that can be obtained from inlining and cloning, especially when guided by profile information. Our implementation of inlining and cloning yields excellent results on average and very rarely lowers performance. We believe our good results can be explained by a number of factors: inlining at the intermediate-code level removes most technical restrictions on what can be inlined; the ability to inline across files and incorporate profile information enables us to choose better inline candidates; a high-quality back end can exploit the scheduling and register allocation opportunities presented by larger subroutines; an aggressive processor architecture benefits from more predictable branch behavior; and a large instruction cache mitigates the impact of code expansion. We describe the often dramatic impact of our inlining and cloning on performance: for example, the implementations of our inlining and cloning algorithms in the HP-UX 10.20 compilers boost SPECint95 performance on a PA8000-based workstation by a factor of 1.32.
- 1 F. C. Allen and J. Cocke. A catalogue of optimizing transformations. In Design and Optimization of Compilers, R. Ruskin, Ed., Prentice-Hall, Englewood Cliffs, N J, 1971, 1-30.Google Scholar
- 2 R. Allen and S. Johnson. Compiling C for vectorization, parallelization, and inline expansion. Proceedings of the A CM SIGPLAN '88 Conference on Programming Language Design and Implementation, 241-249. Google ScholarDigital Library
- 3 J. Ball. Predicting the effects of optimization on a procedure body. A CM SIGPLAN Notices lj(8), 214-220, 1979. Google ScholarDigital Library
- 4 P. Carini. Automatic Inlining. IBM Research Report RC 20286, November 1995.Google Scholar
- 5 P. P. Chang, S. A. Mahlke, W. Y. Chen, and W. W. Hwu. Profile-guided automatic inline expansion for C programs. Software Practice and Experience 22(5), 349-369, May 1992. Google ScholarDigital Library
- 6 K. D. Cooper, M. W. Hall, and K. Kennedy. A methodology for procedure cloning. Computer Languages, 19(2), 105-117, February 1993.Google ScholarDigital Library
- 7 J. W. Davidson and A. M. Holler. A study of a C function inliner. Software Practice and Experience 18(8), 775-790, August 1988. Google ScholarDigital Library
- 8 J. Dean and C. Chambers. Training compilers to make better inlining decisions. Technical Report 93-05-05, Department of Computer Science and Engineering, University of Washington, 1993.Google Scholar
- 9 A. M. Holler. Compiler optimizations for the PA- 8000. COMPCON 1997 Digest of Papers, February 1997. Google ScholarDigital Library
- 10 D. Hunt. Advanced performance features of the 64- bit PA8000. COMPCON 1995 Digest of Papers, 123-128, March 1995. Google ScholarDigital Library
- 11 W. W. Hwu and P. P. Chang. Inline function expansion for compiling C programs. Proceedings of the A CM SIGPLAN '89 Conference on Programming Language Design and Implementation, 246- 257. Google ScholarDigital Library
- 12 K. Pettis and R. C. Hansen. Profile guided code positioning. In Proceedings of the A CM SIGPLAN '90 Conference on Programming Language Design and Implementation, 16-27. Google ScholarDigital Library
- 13 S. Richardson and M. Ganapathi. Interprocedural analysis versus procedure integration. Information Processing Letters, 3~(3), 137-142, August 1989. Google ScholarDigital Library
- 14 R. W. Sehiefler. An analysis of inline substitution for a structured programming language. Communications of the A CM 20(9), 647-654, September 1977. Google ScholarDigital Library
- 15 S. E. Speer, R. Kumar, and C. Partridge. Improving UNIX Kernel Performance using Profile Based Optimization. In USENIX 199J Proceedings. Google ScholarDigital Library
Index Terms
- Aggressive inlining
Recommendations
Towards better inlining decisions using inlining trials
LFP '94: Proceedings of the 1994 ACM conference on LISP and functional programmingInlining trials are a general mechanism for making better automatic decisions about whether a routine is profitable to inline. Unlike standard source-level inlining heuristics, an inlining trial captures the effects of optimizations applied to the body ...
Aggressive inlining
PLDI '97: Proceedings of the ACM SIGPLAN 1997 conference on Programming language design and implementationExisting research understates the benefits that can be obtained from inlining and cloning, especially when guided by profile information. Our implementation of inlining and cloning yields excellent results on average and very rarely lowers performance. ...
Aggressive function inlining: preventing loop blockings in the instruction cache
HiPEAC'08: Proceedings of the 3rd international conference on High performance embedded architectures and compilersAggressive 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 ...
Comments