Other optimization options

Options are available to control particular aspects of optimization. They are often enabled as a group or given default values when you enable a more general optimization option or level.

For more information on these options, see the heading for each option in the XL C/C++ Compiler Reference.

Table 1. Selected compiler options for optimizing performance
Option Description
-qignerrno Allows the compiler to assume that errno is not modified by library function calls, so that such calls can be optimized. Also allows optimization of square root operations, by generating inline code rather than calling a library function. (For processors that support sqrt.)
-qsmallstack Instructs the compiler to compact stack storage. Doing so may increase heap usage.
-qinline Controls inlining.
-qunroll Independently controls loop unrolling. -qunroll is implicitly activated under -O3.
-qtbtable Controls the generation of traceback table information.
C++ only -qnoeh Informs the compiler that no C++ exceptions will be thrown and that cleanup code can be omitted. If your program does not throw any C++ exceptions, use this option to compact your program by removing exception-handling code.
-qnounwind Informs the compiler that the stack will not be unwound while any routine in this compilation is active. This option can improve optimization of non-volatile register saves and restores. In C++, the -qnounwind option implies the -qnoeh option.
-qstrict Disables all transformations that change program semantics. In general, compiling a program correctly with -qstrict and any levels of optimization produces the same results as without optimization. For details about -qstrict and all of its suboptions, see -qstrict in the XL C/C++ Compiler Reference.
-qnostrict Allows the compiler to reorder floating-point calculations and potentially excepting instructions. A potentially excepting instruction is one that might raise an interrupt due to erroneous execution (for example, floating-point overflow, a memory access violation). -qnostrict is used by default for optimization levels -O3 and higher.
-qprefetch Inserts prefetch instructions in compiled code to improve code performance. In situations where you are working with applications that generate a high cache-miss rate, you can use its suboption assistthread to generate prefetching assist threads (for example, -qprefetch=assistthread). -qnoprefetch is the default option. For details, see -qprefetch in the XL C/C++ Compiler Reference.