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 and loop invariant code |
Dead code elimination | Code size |
Propagation of function characteristics | Call deletion and call movement |
Multifile optimization | The same aspects as -ip, but across multiple files |
IA-32 applications only
Optimization | Affected Aspect of Program |
---|---|
Passing arguments in registers | Calls and register usage |
Loop-invariant code motion | Further optimizations and 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.
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.