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.
Table 1. Advanced optimizations
Optimization Level Additional options implied Complementary options Options with possible benefits
-O3
  • -qnostrict
  • -qmaxmem=-1
  • -qhot=level=0
  • -qarch
  • -qtune
  • -qpdf
-O4
  • -qnostrict
  • -qmaxmem=-1
  • -qhot
  • -qipa
  • -qarch=auto
  • -qtune=auto
  • -qcache=auto
  • -qarch
  • -qtune
  • -qcache
  • -qpdf
  • -qsmp=auto
-O5
  • All of -O4
  • -qipa=level=2
  • -qarch
  • -qtune
  • -qcache
  • -qpdf
  • -qsmp=auto
When you compile programs with any of the following sets of options:
  • -O3 -qhot
  • -O4
  • -O5
the compiler automatically attempts to vectorize calls to system math functions by calling the equivalent vector functions in the Mathematical Acceleration Subsystem libraries (MASS), with the exceptions of functions 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.



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us