Interprocedural analysis (IPA) enables the compiler to optimize across different files (whole-program analysis), and can result in significant performance improvements. Interprocedural analysis can be specified on the compile step only, or on both compile and link steps (whole program mode). Whole program mode expands the scope of optimization to an entire program unit, which can be an executable or shared object. Whole program IPA analysis can consume significant amounts of memory and time when compiling or linking large programs.
IPA is enabled by the -qipa option. A summary of the
effects of the most commonly used suboptions follows.
Commonly used -qipa suboptions | |
Suboption | Behavior |
---|---|
level=0 | Program partitioning and simple interprocedural optimization, which
consists of:
|
level=1 | Inlining and global data mapping. Specifically,
This is the default level when -qipa is specified. |
level=2 | Global alias analysis, specialization, interprocedural data flow.
|
inline=inline-options | Provides precise user control of inlining. |
fine_tuning | Other values for -qipa= provide the ability to specify the behavior of library code, tune program partioning, read commands from a file, and so on. |
It is not necessary to compile everything with -qipa, but try to apply it to as much of your program as possible. Here are some suggestions.