HP aC++/HP C Programmer's Guide (B3901-90036; A.06.26; September 2011)
Removing Compilation Time Limits When Optimizing
You can remove optimization time restrictions at the second, third, or fourth optimization
levels by using the +Onolimit option as follows:
aCC +O2 +Onolimit sourcefile.C
or:
aCC +O3 +Onolimit sourcefile.C
or:
aCC +O4 +Onolimit sourcefile.C
By default, the optimizer limits the amount of time spent optimizing large programs at
levels 2, 3, and 4. Use this option if longer compile times are acceptable because you
want additional optimizations to be performed.
Limiting the Size of Optimized Code
You can disable optimizations that expand code size at the second, third, and fourth
optimization levels by using the +Osize suboption, as follows:
aCC +O2 +Osize sourcefile.C
or:
aCC +O3 +Osize sourcefile.C
or:
aCC +O4 +Osize sourcefile.C
Most optimizations improve execution speed and decrease executable code size. A few
optimizations significantly increase code size to gain execution speed. The +Osize
option disables these code-expanding optimizations.
Use this option if you have limited main memory, swap space, or disk space.
Combining Optimization Options
Optimization options that affect code size, (+Osize), compile-time (+Olimit), and the
aggressiveness of the optimizations performed can be combined at any of the optimization
levels 2 through 4.
Profile-Based Optimization
Profile-based optimization (PBO) is a set of performance-improving code transformations
based on the runtime characteristics of your application.
When using profile-based optimization, please note the following:
• Numerical applications that perform the same calculations independent of the input
data will only see a small performance boost.
• Profile-based optimization has the greatest impact on application performance when
used with level 2 or greater optimizations.
Requesting Optimization 197