Criteria for Inline Function Expansion

For a routine to be considered for inlining, it has to meet certain minimum criteria. There are criteria to be met by the call-site, the caller, and the callee. The call-site is the site of the call to the function that might be inlined. The caller is the function that contains the call-site. The callee is the function being called that might be inlined.

Minimum call-site criteria:

Minimum criteria for the caller:

-Qoptionf,-ip_inline_max_total_stats=new value

Minimum criteria for the callee:

Selecting Routines for Inlining

Once these criteria are met, the compiler picks the routines whose inline expansions will provide the greatest benefit to program performance. This is done using the default heuristics. The inlining heuristics used by the compiler differ based on whether you use profile-guided optimizations (-prof_use) or not.

When you use profile-guided optimizations with -ip or -ipo, the compiler uses the following heuristics:

Default for ItaniumŪ-based applications: ip_ninl_min_stats = 15.

Default for IA-32 applications: ip_ninl_min_stats = 7.

These limits can be modified with the option -Qoption,f,/ip_ninl_min_stats=new value. See
-Qoption
Specifiers and Profile-Guided Optimization (PGO).

When you do not use profile-guided optimizations with -ip or -ipo, the compiler uses less aggressive inlining heuristics: it inlines a function if the inline expansion does not increase the size of the final program.