HP Fortran Programmer Guide (766160-001, March 2014)
Table 15 Levels of optimization
OptimizationsLevel
Local optimizations, including constant folding and partial evaluation of test conditions.0
Peephole optimizations, including:1
• Basic block optimizations
• Branch optimizations
• Instruction scheduling
Optimizations performed at level 1, plus the following:2
• Coloring register allocation
• Induction variables and strength reduction
• Common subexpression elimination
• Loop invariant code motion
• Store/copy optimization
• Unused definition elimination
• Dataflow analysis
• Software pipelining
• Scalar replacement
• Sum reduction optimization
Optimizations performed at levels 1 and 2, plus the following:3
• Interprocedural optimizations, including cloning and inlining
• Loop transformations to improve memory performance, including fusion and interchange
Level 4 optimizations are not currently supported by the PA-RISC compiler. If +O4is specified, the
compiler will issue a warning message and compile at optimization level 3.
4
For Itanium® applications, performs level 3as well as doing interprocedural optimizations across
translation units (link time optimizations). Object files generated at this level contain an intermediate
representation of the user code and are intended to be temporary files. These intermediate object
files are not guaranteed to be compatible from one version of the compiler to the next. This
requires concurrent use of the +Oprofile=use option.
Decrease the optimization to optlevel for one or more specified routines. This option can
occur at optimization levels 1, 2, 3, or 4. The option cannot raise the optimization level above
what was specified in the+Ooptlevel option. This option can occur multiple times, possibly
with different values of optlevel.
-o names the executable file outfile rather than the default name of a.out. If not specified,
a.out will be overwritten if it exists, or created if it does not. The outfile name must not end
-ooutfile
with .f,.f90,.F, i, or .i90. Also, it must not begin with + or -. When using -c and -o together,
you may specify only one source file on the command line; the resulting object file is renamed.
This option, when used with any of the -goptions, will cause the debug information to be left in
the object files instead of being placed in the a.out. This will bypass the pxdb step and the
+[no]objdebug
links will be faster. This is available only for wdb(1) or gdb(1). +objdebug is the default at
compile time. +noobjdebug can be used at link time to continue to place the debug info into
the a.out, even if some objects were compiled with +objdebug.
32 Compiling and linking