Compiling with -qpdf1

Compile some or all of the source files in a program with the -qpdf1 option. This step is called the PDF1 step.

Usage

You do not have to compile all of the files of the programs with the -qpdf1 option. In a large application, you can concentrate on those areas of the code that can benefit most from the optimization.

When you compile multiple programs with -qpdf1, you must ensure that the PDF file that is to be generated in the PDF2 step has a different name for each program because each PDF file can contain data for only one application. Otherwise, if the PDF file names of multiple programs are the same, you can run the first application in the PDF training step and write profile information into the PDF file successfully. However, if you try to run the second application, an error is issued to indicate that there is an existing incompatible PDF file and the program exits with a nonzero return code.

PDF optimization must be done at least at the -O2 optimization level and is recommended at -O4 and higher.

When you compile your program with -qpdf1, the -qipa=level=0 option is enabled by default. When option -O4, -O5, or any level of option -qipa is in effect, and you specify the -qpdf1 option at the link step but not at the compile step, the compiler issues a warning message. The message indicates that you must recompile your program to get all the profiling information.

A PDF map file is generated at this step. You can use the showpdf command to display part of the profiling information in text or XML format. If you do not need to view the profiling information, specify the -qnoshowpdf option at this step so that the PDF map file is not generated.

Example

You can compile the following source files with -qpdf1 at -O3.
xlc -qpdf1 -O3 file1.c file2.c file3.c


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us