HP C Programmer's Guide (92434-90009)

Chapter 4 75
Optimizing HP C Programs
Controlling Specific Optimizer Features
n
> 100 More aggressive inlining. The optimizer is less restricted by compilation time
and code size when searching for eligible routines to inline.
n
= 1 Only inline if it reduces code size.
The +Onolimit and +Osize options also affect inlining. Specifying the +Onolimit option
has the same effect as specifying +Oinline_budget=200. The +Osize option has the same
effect as +Oinline_budget=1.
Note, however, that the +Oinline_budget option takes precedence over both of these
options. This means that you can override the effect of +Onolimit or +Osize option on
inlining by specifying the +Oinline_budget option on the same compile line.
+O[no]libcalls
Optimization level(s): 0, 1, 2, 3, 4
Default: +Onolibcalls
Use the +Olibcalls option to increase the runtime performance of code which calls
standard library routines in simple contexts. The +Olibcalls option expands the
following library calls inline:
strcpy()
sqrt()
fabs()
alloca()
Inlining will take place only if the function call follows the prototype definition the
appropriate header file. Fast subprogram linkage is also emitted to tuned millicode
versions of the math library functions sin, cos, tan, atan 2, log, pow,
asin, acos, atan, exp, and log10. (See the HP-UX Floating-Point Guide for the most
up-to-date listing of the math library functions.) The calling code must not expect to access
ERRNO after the function's return.
A single call to printf() may be replaced by a series of calls to putchar(). Calls to
sprintf() and strlen() may be optimized more effectively, including elimination of some
calls producing unused results. Calls to setjmp() and longjmp() may be replaced by their
equivalents _setjmp() and _longjmp(), which do not manipulate the process's signal
mask.
Use +Olibcalls to improve the performance of selected library routines only when you are
not performing error checking for these routines.
Using +Olibcalls with +Ofltacc will give different floating point calculation results than
those given using +Ofltacc without +Olibcalls.
The +Olibcalls option replaces the obsolete -J option.
+O[no]loop_transform
Optimization level(s): 3, 4
Default: +Oloop_transform