HP C Programmer's Guide (92434-90009)

82 Chapter4
Optimizing HP C Programs
Controlling Specific Optimizer Features
with a pointer to private memory may run incorrectly if this optimization is enabled.
Use +Osignedpointers to improve application run-time speed.
+O[no]static_prediction
Optimization level(s): 0, 1, 2, 3, 4
Default: +Onostatic_prediction
+Ostatic_prediction turns on static branch prediction for PA-RISC 2.0 targets.
PA-RISC 2.0 has two means of predicting which way conditional branches will go: dynamic
branch prediction and static branch prediction. Dynamic branch prediction uses a
hardware history mechanism to predict future executions of a branch from its last three
executions. It is transparent and quite effective unless the hardware buffers involved are
overwhelmed by a large program with poor locality.
With static branch prediction on, each branch is predicted based on implicit hints encoded
in the branch instruction itself; the dynamic branch prediction is not used.
Static branch prediction's role is to handle large codes with poor locality for which the
small dynamic hardware facility will prove inadequate.
Use +Ostatic_prediction to better optimize large programs with poor instruction
locality, such as operating system and database code.
Use this option only when using PBO, as an amplifier to +P. It is allowed but silently
ignored with +I, so makefiles need not change between the +I and +P phases.
+O[no]vectorize
Optimization level(s): 0, 1, 2, 3, 4
Default: +Onovectorize
+Ovectorize allows the compiler to replace certain loops with calls to vector routines.
Use +Ovectorize to increase the execution speed of loops.
When +Onovectorize is specified, loops are not replaced with calls to vector routines.
Because the +Ovectorize option may change the order of operations in an application, it
may also change the results of those operations slightly. See the HP-UX Floating-Point
Guide for details.
The math library contains special prefetching versions of vector routines. If you have a
PA2.0 application that contains operations on very large arrays (larger than 1 megabyte in
size), using +Ovectorize in conjunction with +Odataprefetch may improve performance
substantially.
You may use +Ovectorize at levels 3 and 4. +Onovectorize is also included as part of
+Oaggressive and +Oall.
This option is only valid for PA-RISC 1.1 and 2.0 systems.