 |
» |
|
|
 |
|  |  |
HP Pascal/HP-UX supports five levels of optimization. The
corresponding command-line options are summarized in Table 1-1 “Optimization Levels ”.  |  |  |  |  | NOTE: HP Pascal/HP-UX does not support some of the +O3
and +O4 optimization
features that are available in other compilers. |  |  |  |  |
Table 1-1 Optimization Levels Option | Meaning |
|---|
+O0 | Minimal optimization, including constant
folding and simple register assignment. This is the default. | +O1 | Branch optimizations, instruction re-scheduling,
faster register allocation, and other block-level optimizations. At
this level of optimization, programs compile quickly and still realize
some execution speed-up. | +O2 | Full optimization within each subprogram
in a file, including store and copy optimization, software pipelining,
and register reassociation. Compiling at this level
of optimization may take longer, but can greatly improve run-time
performance. The -O
command-line option also invokes this level of optimization. | +O3 | Full optimization of all subprograms
within a compilation unit, including data-flow analysis and subprogram
inlining. Compiling at this level takes longer than
at the previous levels but can result in faster executable code. Note
that you can achieve the pre-Release 10.0 behavior of +O3
by optimizing with +O2 +Ofastaccess. | +O4 | Full optimization across all files in
the program that were compiled with +O4.
Performed at link time. By postponing optimization until link time,
the optimizer can make the best use of execution profiling information
and can perform inlining across multiple source files. Postponing
optimization until link time reduces the time spent in the compile
phase, but it can increase the time and memory required to link
the program, especially if it is large. However, it can result in
the most efficient executable code. |
|