Basic optimization

The XL compiler supports several levels of optimization, with each option level building on the levels below through increasingly aggressive transformations and consequently using more machine resources.

Ensure that your application compiles and executes properly at low optimization levels before you try more aggressive optimizations. This topic discusses two optimizations levels, listed with complementary options in Table 1. The table also includes a column for compiler options that can have a performance benefit at that optimization level for some applications.
Table 1. Basic optimizations
Optimization level Additional options implied by default Complementary options Other options with possible benefits
-O0
  • None
  • -qarch
  • None
-O2
  • -qmaxmem=8192
  • -qarch
  • -qtune
  • -qmaxmem=-1
  • -qhot=level=0


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