HP Fortran Programmer Guide HP-UX 11i v1, HP-UX 11i v2, and HP-UX 11i v3 (B3908-90032,December 2012)
Fine-tuning optimization options
The following options allow you to fine-tune the optimization process by providing control over the
specific techniques that the optimizer applies to your program. The syntax for using these options
is
where optimizationis a parameter that specifies an
optimization technique to apply to your program. The
+O[no]optimization
different parameters are described below. The prefix
nonegates the effect of optimization.
The options do not override a specified level of optimization, nor do they imply a particular level.
To use any of these options you must also include the +Onoption on the same command line, where
n specifies the level at which the type of optimization can be performed.
For example, if you find that the optimizer is causing your program to produce different floating-point
results from those produced by the unoptimized program, you could use the following command
line to suppress optimizations that affect floating-point calculations:
f90 +O3 +Onomoveflops +Ofltacc my_prog.f90
If an option is mistakenly used at a level for which the corresponding optimization is not performed,
the compiler will issue a warning message.
The defaults given in the following descriptions are in effect only at the specified optimization
levels, unless stated otherwise.
+Ocache_pad_commoncan improve program
performance by padding common blocks to avoid
+O[no]cache_pad_common
cache collisions. Cache-line collisions occur when the
difference between the addresses of two data points
is a multiple of the cache size. By inserting empty
space between large variables (for example, arrays),
the optimizer ensures that they do not start at nearby
addresses, where the possibility of a cache collision
is greater. This option is only effective at optimization
level 3 or higher.
Note the following precautions when using this option:
• All program modules that reference the common
block must be compiled with the
+Ocache_pad_commonoption.
• Each common block in the program should have
the same layout in all program units within which
it is declared. If the layouts are different, they must
be fully independent—that is, they must not pass
values between them.
The default, +Onocache_pad_common, disables
padding.
Enables [disables] the use of floating point math in the
compilation unit.
The default is +Onocxlimitedrange.
+O[no]cxlimitedrange
Enable [disable] the use of cross-region addressing.
Cross-region addressing is required if a pointer (such
+O[no]cross_region_addressing
as an array base) points to a different region than the
data being addressed. This is usually due to an offset
which results in a cross-over into another region.
Standard-conforming applications do not require the
use of cross-region addressing. The default is
+onocross_region_addressing.
+Odataprefetchcauses the optimizer to insert
instructions within innermost loops to explicitly prefetch
+O[no]dataprefetch
Fine-tuning optimization options 39