Interprocedural analysis (IPA) enables the compiler to optimize across different files (whole-program analysis), and can result in significant performance improvements.
You can specify interprocedural analysis on the compile step only or on both compile 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 shared object. As IPA can significantly increase compile time, you should limit using IPA to the final performance tuning stage of development.
You can generate relinkable objects while preserving IPA information by specifying -r -qipa=relink. This creates a nonexecutable package that contains all object files. By using this suboption, you can postpone linking until the very last stage.
If you want to use your own archive files while generating the nonexecutable package, you can use the ar tool and set the XL_AR environment variable to point to the ar tool. For details, refer to the -qipa section of the XL C/C++ Compiler Reference.
You 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 .
| 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, etc. |
| relink | Creates a nonexecutable package that contains all of your object files while preserving IPA information. |