Recompiling or linking with -qpdf2

Recompile or link your program by using the same compiler options as before, but change -qpdf1 to -qpdf2. This step is called the PDF2 step.

If you want to optimize the entire application, you can do the PDF2 step at executable level in the link step and create executable files for your programs. For details, see Executable level profile-directed feedback.

In addition to optimizing entire application, you can do the PDF2 step at object level in the compile time and create object files for your programs. This can be an advantage for applications where patches or updates are distributed as object files or libraries rather than as executables. In this case, you cannot enable interprocedural analysis (IPA) optimizations. For details, see Object level profile-directed feedback.

Usage

The accumulated profiling information is used to fine-tune the optimizations. The resulting program contains no profiling overhead and runs at full speed. You must ensure the PDF file that is fed into the PDF2 step is the one that is generated in the PDF training step. For example, when the -qpdf1=pdfname=file_path option is used during the PDF1 step, you must use the same -qpdf2=pdfname=file_path option during the PDF2 step for the compiler to recognize the correct PDF file. This rule also applies to the -qpdf[1|2]=exename and -qpdf[1|2]=defname options.

You are highly recommended to use the same optimization level at all compilation steps for a particular program. Otherwise, the PDF process cannot optimize your program correctly and might even slow it down. All compiler settings that affect optimization must be the same, including any supplied by configuration files.

You can modify your source code and use the -qpdf1 and -qpdf2 options to compile your program. Old profiling information can still be preserved and used during the second stage of the PDF process. The compiler issues a list of warnings but the compilation does not stop. An information message is also issued with a number in the range of 0 - 100 to indicate how outdated the old profiling information is. If you have not changed your program between the -qpdf1 and -qpdf2 phases, the number is 100, which means that all the profiling information can be used to optimize the program. If the number is 0, it means that the profiling information is completely outdated, and the compiler cannot take advantage of any information. When the number is less than 100, you can choose to recompile your program with the -qpdf1 option and regenerate the profiling information.

If the compiler cannot read any PDF files in this step, the compiler issues error message 1586-401 but continues the compilation.

If you want to erase the PDF information, use the cleanpdf command.



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