Overview: Interprocedural Optimizations

Use -ip and -ipo to enable interprocedural optimizations (IPO), which allow the compiler to analyze your code to determine where to apply the optimizations listed in tables that follow.

IA-32 and Itanium®-based Applications

Optimization Affected Aspect of Program
Inline function expansion Calls, jumps, branches, and loops
Interprocedural constant propagation Arguments, global variables, and return values
Monitoring module-level static variables Further optimizations, loop invariant code
Dead code elimination Code size
Propagation of function characteristics Call deletion and call movement. Also enables knowledge of functions that will not return, whether exceptions are thrown, the stack needs alignment, or alignment of arguments.
Multifile optimization Affects the same aspects as -ip, but across multiple files

IA-32 applications only

Optimization Affected Aspect of Program
Passing arguments in registers Calls, register usage

Inline function expansion is one of the main optimizations performed by the interprocedural optimizer. For function calls that the compiler believes are frequently executed, the compiler might decide to replace the instructions of the call with code for the function itself (inline the call).

With -ip, the compiler performs inline function expansion for calls to functions defined within the current source file. However, when you use -ipo to specify multifile IPO, the compiler performs inline function expansion for calls to functions defined in separate files. For this reason, it is important to compile the entire application or multiple, related source files together when you specify -ipo.

The IPO optimizations are disabled by default.