Options for performance optimization

Table 18. Options for defined optimization levels
Option name Type Default Description
-O, -qoptimize, -qoptimize -flag, -qopt -qnooptimize Optimizes code at a choice of levels during compilation.

Table 19. Options for ABI performance tuning
Option name Type Default Description
-qdataimported -qopt - Marks data as imported.
-qdatalocal -qopt - Marks data as local.
-qlibansi -qopt -qnolibansi Assumes that all functions with the name of an ANSI C library function are in fact the system functions.
-qproclocal, -qprocimported, -qprocunknown -qopt See -qproclocal, -qprocimported, -qprocunknown. Marks functions as local, imported, or unknown.
-qtocdata -qopt -qnotocdata. Specifies the thread-local storage model to be used by the application.
-qtocmerge -qopt -qnotocmerge. Enables TOC merging to reduce TOC pointer loads and improves the scheduling of external loads.
-qunwind -qopt -qunwind Informs the compiler that the application does not rely on any program stack unwinding mechanism.
Table 20. Options that restrict optimization
Option name Type Default Description
-qprefetch -qopt -qprefetch Enables generation of prefetching instructions in compiled code.
-qsmallstack -qopt -qnosmallstack Instructs the compiler to reduce the size of the stack frame.
-qspill -qopt -qspill=512 Specifies the size of the register allocation spill area.
-qstrict -qopt See -qstrict. Turns off aggressive optimizations of the -O3 option that have the potential to alter the semantics of your program.

Table 21. Options for processor and architectural optimization
Option name Type Default Description
-qarch -qopt -qarch=com Specifies the architecture on which the executable program will be run.
-qcache -qopt - Specifies a cache configuration for a specific execution machine.
-qdirectstorage -qopt -qnodirectstorage. Informs the compiler that write-through enabled or cache-inhibited storage may be referenced.
-qtune -qopt See -qtune. Specifies the architecture for which the executable program is optimized.
-qvecnvol -qopt -qnovecnvol Specifies whether to use volatile or non-volatile vector registers.
Table 22. Options for loop optimization
Option name Type Default Description
-qhot -qopt -qnohot Instructs the compiler to perform high-order loop analysis and transformations during optimization.
-qstrict_induction -qopt See -qstrict_induction. Disables loop induction variable optimizations that have the potential to alter the semantics of your program.
-qunroll -qopt -qunroll=auto Unrolls inner loops in the program.

Table 23. Options for code size reduction
Option name Type Default Description
-qcompact -qopt -qnocompact When used with optimization, reduces code size where possible, at the expense of execution speed.
C++ only -qeh -qopt -qeh Controls exception handling.
C++ only -qkeepinlines -qopt -qnokeepinlines Instructs the compiler to keep or discard definitions for unreferenced extern inline functions.

Table 24. Options for whole-program analysis
Option name Type Default Description
-qipa -qopt See -qipa. Turns on or customizes a class of optimizations known as interprocedural analysis (IPA).
-qlargepage -qopt -qnolargepage. Instructs the compiler to exploit large page heaps available on Power 4 systems running AIX(R) v5.1D or later.

Table 25. Options for function inlining
Option name Type Default Description
-qinline -qopt See -qinline. Attempts to inline functions instead of generating calls to a function.
-Q -flag See -Q. Attempts to inline functions.

Table 26. Options for performance data collection
Option name Type Default Description
-qfdpr -qopt -qnofdpr Collects program information for use with the AIX fdpr performance-tuning utility.
-qpdf1, -qpdf2 -qopt -qnopdf1, -qnopdf2 Tunes optimizations through profile-directed feedback.
-qshowpdf -qopt -qnoshowpdf Used together with -qpdf1 and a minimum of -O to add additional call and block count profiling information to an executable.

Table 27. Options for aliasing
Option name Type Default Description
-qalias -qopt See -qalias. Specifies which type-based aliasing is to be used during optimization.
-qansialias -qopt See -qansialias. Specifies whether type-based aliasing is to be used during optimization.
C only -qassert -qopt -qnoassert Instructs the compiler to apply aliasing assertions to your compilation unit.

Table 28. Options for side effects
Option name Type Default Description
-qignerrno -qopt -qnoignerrno Allows the compiler to perform optimizations that assume errno is not modified by system calls.
-qisolated_call -qopt - Specifies functions in the source file that have no side effects.