In addition to optimizing entire executables, profile-directed feedback (PDF) can also be applied to specific objects. This can be an advantage in applications where patches or updates are distributed as object files or libraries rather than as executables. Also, specific areas of functionality in your application can be optimized without you needing to go through the process of relinking the entire application. In large applications, you can save the time and trouble that otherwise need to be spent relinking the application.
The process for using object level PDF is essentially the same as the standard PDF process but with a small change to the -qpdf2 step. For object level PDF, compile your program using the -qpdf1 option, execute the resulting application with representative data, compile the program again with the -qpdf2 option, but now also use the -qnoipa option so that the linking step is skipped.
xlc -O3 -qpdf1=pdfname=myprofile file1.c file2.c file3.c
Without
the pdfname suboption, by default the file name
is ._pdf; the location of the file is the
current working directory or whatever directory you have set using
the PDFDIR environment variable. If the PDFDIR environment variable
is set but the specified directory does not exist, the compiler issues
a warning message.For details, see -qpdf1, -qpdf2.