HP Pascal/HP-UX Release Notes Version A.10.08

22 Chapter 1
New and Changed Features
Profile-Based Optimization (PBO)
Profile-Based Optimization (PBO)
Profile-based optimization (PBO) is a set of code-improving
transformations that are based on feedback concerning the run-time
characteristics of an application. Run-time profile data is collected
during program execution. This information is fed back to the optimizer,
which performs a variety of optimizations based upon how frequently
certain code is executed and how frequently calls are made between
different code segments. In general, each higher level of optimization
takes increasing advantage of the PBO-generated information.
One of the goals of PBO is to improve the efficiency of memory access by
increasing the hit rates for the instruction cache, memory pages, and the
Translation Lookaside Buffer (TLB). PBO can also improve the
compiler's inlining decisions. One basis for the decision is call frequency,
which, without PBO, the compiler can only estimate. With PBO, however,
the compiler uses actual frequencies as the basis for its decision.
For complete details on PBO, see HP-UX Linker and Libraries Online
User Guide.
NOTE HP Pascal/HP-UX is limited to procedure repositioning, not basic block
repositioning.
Invoking PBO
You must perform the following steps to invoke PBO:
1. Compile and link with the +I option to produce the instrumented
program.
2. Collect execution profile statistics by running the instrumented
program.
3. Optimize the program with the +P option.
Instrumenting the Program
To instrument the program, use the +I compile-line option when
compiling and linking the object files of an application. Instrumenting
the program inserts code into the program to collect execution profile
statistics. Execution profile statistics include a count of the calls between