Using interprocedural analysis
Interprocedural analysis (IPA) enables the compiler to optimize across different files (whole-program analysis), and it can result in significant performance improvements.
You can specify interprocedural analysis on the compilation step only or on both compilation and link steps in whole program mode. Whole program mode expands the scope of optimization to an entire program unit, which can be an executable or a shared object. As IPA can significantly increase compilation time, you should limit using IPA to the final performance tuning stage of development.
You can enable IPA by specifying the -qipa option. The most commonly used suboptions and their effects are described in the following table. The full set of suboptions and syntax is described in -qipa .
- Do preliminary performance analysis and tuning before compiling with the -qipa option, because the IPA analysis uses a two-pass mechanism that increases compilation time and link time. You can reduce some compilation and link overhead by using the -qipa=noobject option.
- Specify the -qipa option on both the compilation and the link steps of the entire application, or as much of it as possible. Use suboptions to indicate assumptions to be made about parts of the program not compiled with -qipa.
Suboption | Behavior |
---|---|
level=0 | Program partitioning and simple interprocedural
optimization, which consists of:
|
level=1 | Inlining and global data mapping. Specifically:
|
level=2 | Global alias analysis, specialization, interprocedural
data flow:
|
inline=suboptions | Provides precise control over function inlining. |
fine_tuning | Other values for -qipa provide the ability to specify the behavior of library code, tune program partitioning, read commands from a file, and so on. |