AMD 250 Computer Hardware User Manual


 
150 Scheduling Optimizations Chapter 7
25112 Rev. 3.06 September 2005
Software Optimization Guide for AMD64 Processors
Additional Recommendations
In general, function inlining works best if the compiler utilizes feedback from a profiler to identify the
function calls most frequently executed. If such data is not available, a reasonable approach is to
concentrate on function calls inside loops. Do not consider as candidates for inlining any functions
that are directly recursive. However, if they are end-recursive, the compiler should convert them to an
iterative equivalent to avoid potential overflow of the processor’s return-prediction mechanism (return
stack) during deep recursion. For best results, a compiler should support function inlining across
multiple source files. In addition, a compiler should provide intrinsic functions for commonly used
library routines, such as sin, strcmp, or memcpy.