When +I is specified along with +O3 or +O4, an I-SOM file is generated. However, HLO is not performed during I-SOM generation. When the I-SOM file is linked, using the +P option to do PBO, HLO is performed, taking advantage of the profile data.

Example 18 The following example illustrates high-level optimization with PBO:

$ cc +I

+O3

-c file.c

//Create I-SOM for instrumentation.

$ cc

+I

+O3

file.o

//Link with instrumentation.

$ a.out

< input_file

//Run instrumented executable with

 

 

 

 

representative input data.

$ cc

+P

+O3

file.o

//Perform PBO and HLO.

 

 

 

 

 

Replace +O3 with +O4 in the above example to get HLO over the entire program and ADDIL elimination. (You may see a warning when using +O4 at instrumentation indicating that the +O4 option is being ignored. You can ignore this warning.)

I-SOM File Restrictions

For the most part, there are not many noticeable differences between I-SOM files and ordinary object files. Exceptions are noted below.

ld

Linking object files compiled with the +I or +P option takes much longer than linking ordinary object files. This is because in addition to the work that the linker already does, the code generator must be run on the intermediate code in the I-SOM files. On the other hand, the time to compile a file with +I or +P is relatively fast because code generation is delayed until link time. All options to ld work normally with I-SOM files with the following exceptions:

Exceptions

Description

 

 

 

The -roption works with both -Iand -P. However, it produces an object file, not an I-SOM

 

file. In 64-bit mode, use -I,-P, or the +nosectionmerge option on a -rlinker command to

 

allow procedures to be positioned independently. Without these options, a -rlink merges

-r

procedures into a single section.

 

 

-s

Do not use this option with -I. However, there is no problem using this option with -P.

 

 

-G

Do not use this option with -I. However, there is no problem using this option with -P.

 

 

-A

Do not use this option with -I or -P.

 

 

-N

Do not use this option with -I or -P.

 

 

nm

The nm command works on I-SOM files. However, because code generation has not yet been performed, some of the imported symbols that may appear in an ordinary relocatable object file does not appear in an I-SOM file.

ar

I-SOM files can be manipulated with ar in exactly the same way that ordinary relocatable files can be.

size

To determine if an object file is an I-SOM file, use the size(1) command. I-SOM files have zero listed for the size of all the sections (text, data and bss (uninitialized data)):.

Linker Optimizations 215