Option Type | Default Values | #pragma options | C | C++ | |
Compile-time | Link-time | ||||
-qoption | object | noipa | - | x |
Syntax
For compile-time use:
-qipa
-qipa=object|noobject
For link-time use:
-qipa [-qlibansi|-qnolibansi]
-qipa=suboption {, suboption} [-qlibansi|-qnolibansi]
-qnoipa [-qlibansi|-qnolibansi]
-qipa Compile-time Formats | Description |
-qipa | Activates interprocedural analysis with the following -qipa
suboption defaults:
|
-qipa=object -qipa=noobject |
Specifies whether to include standard object code in the object files. Specifying the noobject suboption ican substantially reduce overall compile time by not generating object code during the first IPA phase. If the -S compiler option is specified with noobject, noobject is ignored. If compilation and linking are performed in the same step, and neither the -S nor any listing option is specified, -qipa=noobject is implied by default. If any object file used in linking with -qipa was created with the -qipa=noobject option, any file containing an entry point (the main program for an executable program, or an exported function for a library) must be compiled with -qipa. |
-qipa Link-time Formats | Description |
-qnoipa | Deactivates interprocedural analysis. |
-qipa | Activates interprocedural analysis with the following -qipa
suboption defaults:
|
-qlibansi -qnolibansi |
The -qlibansi option assumes that all functions with the
name of an ANSI C defined library function are in fact library functions. This is the
default setting. The -qnolibansi option does not make this assumption. |
Suboptions can take any of the forms shown below. Separate multiple suboptions with commas.
Suboption | Description |
exits=name{,name} | Specifies names of functions which represent program exits. Program exits are calls which can never return and can never call any procedure which has been compiled with IPA pass 1. |
inline[=suboption] | Same as specifying the -qinline compiler option, with suboption being any valid -qinline suboption. |
inline=auto inline=noauto |
Enables or disables automatic inlining only. The compiler still accepts user-specified functions as candidates for inlining. |
inline=name{,name} | Specifies a comma-separated list of functions to try to inline, where functions are identified by name. |
noinline=name{,name} | Specifies a comma-separated list of functions that must not be inlined, where functions are identified by name. |
inline=limit=num | Changes the size limits that the -Q option uses to determine how much inline expansion to do. This established limit is the size below which the calling procedure must remain. number is the optimizer's approximation of the number of bytes of code that will be generated. Larger values for this number allow the compiler to inline larger subprograms, more subprogram calls, or both. This argument is implemented only when inline=auto is on. |
inline=threshold=size | Specifies the upper size limit of functions to be inlined, where size is a value as defined under inline=limit. This argument is implemented only when inline=auto is on. |
isolated=name,{name} | Specifies a list of isolated functions that are not compiled with IPA. Neither isolated functions nor functions within their call chain can refer to global variables. |
level=0 level=1 level=2 |
Specifies the optimization level for interprocedural analysis. The
default level is 1. Valid levels are as follows: Level 0 - Does only minimal interprocedural analysis and optimization. Level 1 - Turns on inlining, limited alias analysis, and limited call-site tailoring. Level 2 - Performs full interprocedural data flow and alias analysis. |
list list=[name] [short|long] |
Specifies that a listing file be generated during the link phase. The
listing file contains information about transformations and analyses performed by IPA, as
well as an optional object listing generated by the back end for each partition. This
option can also be used to specify the name of the listing file. If listings have been requested (using either the -qlist or -qipa=list options), and name is not specified, the listing file name defaults to a.lst. The long and short suboptions can be used to request more or less information in the listing file. The short suboption, which is the default, generates the Object File Map, Source File Map and Global Symbols Map sections of the listing. The long suboption causes the generation of all of the sections generated through the short suboption, as well as the Object Resolution Warnings, Object Reference Map, Inliner Report and Partition Map sections. |
lowfreq=name{,name} | Specifies names of functions which are likely to be called infrequently. These will typically be error handling, trace, or initialization functions. The compiler may be able to make other parts of the program run faster by doing less optimization for calls to these functions. |
missing=attribute | Specifies the interprocedural behavior of procedures that are not compiled with -qipa
and are not explicitly named in an unknown, safe, isolated,
or pure suboption. The following attributes may be used to refine this
information: |
partition=small partition=medium partition=large partition=size |
Specifies the size of each program partition created by IPA during pass 2. The size of the partition is directly proportional to the time required to link and the quality of the generated code. When partition sizes are large, the time to complete linkage is longer but the quality of the generated code is generally better. An integer may be used to specify partition size for finer control. This integer is in terms of unspecified units and its meaning may change from release to release. Its use should be limited to very short term tuning efforts. |
pure=name{,name} | Specifies a list of pure functions that are not compiled with -qipa. Any function specified as pure must be isolated and safe, and must not alter the internal state nor have side-effects, defined as potentially altering any data visible to the caller. |
safe=name{,name} | Specifies a list of safe functions that are not compiled with -qipa. Safe functions can modify global variables, but may not call functions compiled with -qipa. |
unknown=name{,name} | Specifies a list of unknown functions that are not compiled with -qipa. Any function specified as unknown can make calls to other parts of the program compiled with -qipa, and modify global variables and dummy arguments. |
filename | Gives the name of a file which contains suboption information in a special format. The file format is the following: # ... comment attribute{, attribute} = name{, name} missing = attribute}, attribute} exits = name{, name} lowfreq = name{, name} inline [ = auto | = noauto ] inline = name{, name} [ from name{, name}] inline-threshold = unsigned_integer inline-limit = unsigned_integer list [ = file-name | short | long ] noinline noinline = name{, name} [ from name{, name}] level = 0 | 1 | 2 prof [ = file-name ] noprof partition = small | medium | large | unsigned_integer where attribute is one of:
|
Purpose
Turns on or customizes a class of optimizations known as interprocedural analysis (IPA).
Notes
The necessary steps to use IPA are:
Note: If a Severe error occurs during compilation, -qipa returns RC=1 and terminates. Performance analysis also terminates.
Example
To compile a set of files with interprocedural analysis, enter:
xlC -c -O3 *.c -qipa
xlC -o product *.o -qipa
Here is how you might compile the same set of files, improving the optimization of the second compilation, and the speed of the first compile step. Assume that there exits two functions, trace_error and debug_dump, which are rarely executed.
xlC -c -O3 *.c -qipa=noobject
xlC -c - *.o -qipa=lowfreq=trace_error,debug_dump
List of Batch Compiler Options and Their Defaults
Options that Define the Compiler Object Code Produced
Equivalent Batch Compile-Link and Incremental
Build Options