Advanced optimization
Higher optimization levels can have a tremendous impact on performance, but some trade-offs can occur in terms of code size, compile time, resource requirements, and numeric or algorithmic precision.
After applying Basic optimization and successfully compiling
and executing your application, you can apply more powerful optimization tools. The XL compiler
optimization portfolio includes many options for directing advanced optimization, and the
transformations that your application undergoes are largely under your control. The discussion of
each optimization level in Table 1
includes information on the performance benefits and the possible trade-offs and information on how
you can help guide the optimizer to find the best solutions for your application.
| Optimization Level | Additional options implied | Complementary options | Options with possible benefits |
|---|---|---|---|
| -O3 |
|
|
|
| -O4 |
|
|
|
| -O5 |
|
|
|
When you compile programs with any of the following sets of options:
- -qhot -qignerrno -qnostrict
- -O3 -qhot
- -O4
- -O5
vdnint, vdint, vcosisin,
vscosisin, vqdrt, vsqdrt,
vrqdrt, vsrqdrt, vpopcnt4, and
vpopcnt8. If the compiler cannot vectorize, it automatically tries to call the
equivalent MASS scalar functions. For automatic vectorization or scalarization, the compiler uses
versions of the MASS functions contained in the system library libxlopt.a.In addition to any of the preceding sets of options, when the -qipa option is in effect, if the compiler cannot vectorize, it tries to inline the MASS scalar functions before deciding to call them.
