IPO Overview

Use -ip and -ipo to enable interprocedural optimizations (IPO), which enable the compiler to analyze your code to determine where you can benefit from 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

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

loop-invariant code motion

further optimizations, loop invariant code

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.

With -ip, the compiler performs inline function expansion for calls to procedures defined within the current source file. However, when you use -ipo to specify multifile IPO, the compiler performs inline function expansion for calls to procedures defined in separate files.

To disable the IPO optimizations, use the -O0 option.

Caution

The -ip and -ipo options can in some cases significantly increase compile time and code size.

Option -auto_ilp32 for Itanium Compiler

On Itanium-based systems, the -auto_ilp32 option requires interprocedural analysis over the whole program. This optimization allows the compiler to use 32-bit pointers whenever possible as long as the application does not exceed a 32-bit address space. Using the -auto_ilp32 option on programs that exceed 32-bit address space might cause unpredictable results during program execution.

Because this optimization requires interprocedural analysis over the whole program, you must use the
-auto_ilp32
option with the -ipo option.