$ cc +P | //Optimize it, but name it prog.opt. |
The linker is unable to find the program name prog.opt in the flow.data file and issues the error message
No profile data found for the program prog.opt in flow.data
To get around this problem, the compilers and linker provide the +pgm name option, which allows you to specify a program name to look for in the flow.data file. For instance, to make the above example work properly, you would include +pgm prog.inst on the final compile line:
$ cc +P
Like the +df option, the +pgm option is passed directly to the linker.
Selecting an Optimization Level with PBO
When
Option | Description |
|
|
+O0 | Minimal optimization. This is the default. |
|
|
+O1 | Basic block level optimization. |
|
|
+O2 | Full optimization within each procedure in a file. (Can also be invoked as |
|
|
+O3 | Full optimization across all procedures in an object B file. Includes subprogram inlining. |
|
|
+O4 | Full optimization across entire application, performed at link time. (Invokes ld +Ofastaccess |
| +Oprocelim.) Includes inlining across multiple files. |
|
|
|
|
NOTE: The +O3 and +O4 options are incompatible with symbolic debugging. The only compiler optimization levels that allow for symbolic debugging are +O2 and lower.
For more detailed information on compiler optimization levels, see your compiler documentation.
PBO has the greatest impact when it is combined with level 2 or greater optimizations. For instance, this compile command combines level 2 optimization with PBO (note that the compiler options +O2 and
$ cc
/usr/ccs/bin/ld /opt/langtools/lib/icrt0.o
The optimizations are performed along with instrumentation. However,
$ cc
/usr/ccs/bin/ld /usr/ccs/lib/crt0.o
Using PBO to Optimize Shared Libraries
Beginning with the
212 Improving Your Application Performance