Optimization and tuning
The options in this category allow you to control the optimization and tuning process, which can improve the performance of your application at run time.
Remember that not all options benefit all applications. Trade-offs sometimes occur among an increase in compile time, a reduction in debugging capability, and the improvements that optimization can provide.
You can also control some of these options, such as -qoptimize, -qcompact, or -qstrict, with an option_override pragma.
Option name | Equivalent pragma name | Description |
---|---|---|
-qaggrcopy | None. |
Enables destructive copy operations for structures and unions. |
-qalias (-fstrict-aliasing) | None. |
Indicates whether a program contains certain categories of aliasing or does not conform to C/C++ standard aliasing rules. The compiler limits the scope of some optimizations when there is a possibility that different names are aliases for the same storage location. . |
-qarch (-mcpu) | None. |
Specifies the processor architecture for which the code (instructions) should be generated. |
-qcache | None. |
Specifies the cache configuration for a specific execution machine. |
-qcompact | #pragma options compact None. |
Avoids optimizations that increase code size. |
-qdataimported, -qdatalocal, -qtocdata | None. |
Marks data as local or imported. |
-qdirectstorage | None. |
Informs the compiler that a given compilation unit may reference write-through-enabled or cache-inhibited storage. |
-qfdpr | None. |
Provides object files with information that the IBM® Feedback Directed Program Restructuring (FDPR®) performance-tuning utility needs to optimize the resulting executable file. |
-qhot | #pragma nosimd, #pragma novector None. |
Performs high-order loop analysis and transformations (HOT) during optimization. |
-qignerrno | #pragma options ignerrno None. |
Allows the compiler to perform optimizations as if system calls would not
modify |
-qinline (-finline-functions) | None. |
Attempts to inline functions instead of generating calls to those functions, for improved performance. |
-qipa | None. |
Enables or customizes a class of optimizations known as interprocedural analysis (IPA). |
-qisolated_call | #pragma options isolated_call, #pragma isolated_call |
Specifies functions in the source file that have no side effects other than those implied by their parameters. |
-qlargepage | None. |
Takes advantage of large pages provided on POWER4 and higher systems, for applications designed to execute in a large page memory environment. |
-qlibansi | #pragma options libansi None. |
Assumes that all functions with the name of an ANSI C library function are in fact the system functions. |
-qlibmpi | None. |
Asserts that all functions with Message Passing Interface (MPI) names are in fact MPI functions and not a user function with different semantics. |
-qmaxmem | #pragma options maxmem None. |
Limits the amount of memory that the compiler allocates while performing specific, memory-intensive optimizations to the specified number of kilobytes. |
-qminimaltoc | None. |
Controls the generation of the table of contents (TOC), which the compiler creates for an executable file. |
-O, -qoptimize | #pragma options optimize None. |
Specifies whether to optimize code during compilation and, if so, at which level. |
-p, -pg, -qprofile | None. |
Prepares the object files produced by the compiler for profiling. |
-qpdf1, -qpdf2 | None. |
Tunes optimizations through profile-directed feedback (PDF), where results from sample program execution are used to improve optimization near conditional branches and in frequently executed code sections. |
-qprefetch | None. |
Inserts prefetch instructions automatically where there are opportunities to improve code performance. |
-qprocimported, -qproclocal, -qprocunknown | #pragma options procimported, #pragma options proclocal, #pragma options procunkown None. |
Marks functions as local, imported, or unknown. |
-qrestrict | None. |
Specifying this option is equivalent to adding the
|
-qshowpdf | None. |
When used with -qpdf1 and a minimum optimization level of -O2 at compile and link steps, creates a PDF map file that contains additional profiling information for all procedures in your application. |
-qsimd | #pragma nosimd None. |
Controls whether the compiler can automatically take advantage of vector instructions for processors that support them. |
-qsmallstack | None. |
Minimizes stack usage where possible. Disables optimizations that increase the size of the stack frame. |
-qsmp | None. |
Enables parallelization of program code. |
-qspeculateabsolutes | None. |
Works with the -qtocmerge -bl:file for non-IPA links and with the -bl:file for IPA links to disable speculation at absolute addresses. |
-qstrict | #pragma options strict, #pragma option_override (function_name, "opt (suboption_list)") #pragma option_override (function_name, "opt (suboption_list)") |
Ensures that optimizations that are done by default at the -O3 and higher optimization levels, and, optionally at -O2, do not alter the semantics of a program. |
-qstrict_induction | None. |
Prevents the compiler from performing induction (loop counter) variable optimizations. Such optimizations might be problematic when integer overflow operations involving the induction variables occurs. |
-qtocmerge | None. |
Enables TOC merging to reduce TOC pointer loads and improves the scheduling of external loads. |
-qtune (-mtune) | #pragma options tune None. |
Tunes instruction selection, scheduling, and other architecture-dependent performance enhancements to run best on a specific hardware architecture. Allows specification of a target SMT mode to direct optimizations for best performance in that mode. |
-qunroll (-funroll-loops), -qunroll=yes (-funroll-all-loops) | #pragma options unroll, #pragma unroll None. |
Controls loop unrolling, for improved performance. |
-qunwind | None. |
Specifies whether the call stack can be unwound by code looking through the saved registers on the stack. |
-qvisibility (-fvisibility) | #pragma GCC visibility push, #pragma GCC visibility pop |
Specifies the visibility attribute for external linkage entities in object files. The external linkage entities have the visibility attribute that is specified by the -qvisibility option if they do not get visibility attributes from pragma directives, explicitly specified attributes, or propagation rules. |
The following options are supported by XL C/C++ for GCC compatibility. For details about these options, see the GNU Compiler Collection online documentation at http://gcc.gnu.org/onlinedocs/. Note that these GCC options are supported only in the Clang-based front end of IBM XL C/C++ for AIX® 16.1, which is invoked by xlclang/xlclang++.
- --sysroot
- -ffast-math
- -finline-functions
- -fsemantic-interposition
- -fstrict-aliasing
- -funroll-loops
- -funroll-all-loops
- -fvisibility
- -isysroot
- -isystem
- -mcpu
- -mtune