Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

How to use IPO and PGO?

bparkoff
Beginner
647 Views
I use Intel C++ Compiler 8.1 with Visual Studio 6.0 (Enterprise version). I do not wish to use IPO and PGO from the command line. How can I tell Visual C++ 6.0 to invoke IPO and PGO by adding option to the Project's setting?
After I compile my source code, it should be able to save file to debug or release directory.
I looked at User's Guide under Intel directory, but it does not provide a full detail. Can you please help by providing step by step instruction? I appreciate this.
Bryan Parkoff
0 Kudos
7 Replies
JenniferJ
Moderator
647 Views
For using IPO:
Open the "project setting"
under "C/C++" tab, add "/Qipo" to the "Project Options" field.
under "Link" tab, add "/Qipo" to the "Project Options" field too.
Now rebuild your application. It usually takes a long time for linking.
It's better to try -Qipo with "-QxP -O2" together.
For using PGO:
Step1: instrument your app
Open the "project setting"
under "C/C++" tab, add "/Qprof_gen" to the "Project Options" field.
Now rebuild your application
Step2: run your app to generate the data
Step3: optimize your app with the generated data from Step2
Open the "project setting"
under "C/C++" tab, add "/Qprof_use" to the "Project Options" field.
Now rebuild your application
Note: if Step3 couldn't find the data, use "/Qprof_dir" tospecify the directory wherethe data file (*.dynor *.dpi) located.
Please check the User's Guide for more detail information about PGO's stages.
Thanks,
Jennifer
0 Kudos
bparkoff
Beginner
647 Views
Jennifer,
Thank you very much for the information. I have created *.dyn and *.dpi. How do I find the program like Profiler to read *.dpi?
Bryan Parkoff
0 Kudos
TimP
Honored Contributor III
647 Views
When the compiler is invoked with -prof_use, it looks for the corresponding .dpi and .dyn files and extracts data from them.
0 Kudos
maverick6664
Beginner
647 Views
I'm using IPO and PGO at the same time (but on Linux.)

Now I wonder whether when I use PGO, IPO is really effective or not. When PGO is enabled, in phase 3, does IPO really help optimization? PGO does all the optimization (relocate procedures in the assumedly best places,) so I suspect IPO shouldn't help at all or just a little bit.....but since IPO is available along with PGO according to the manual and actually icc/icpc accept them at the same time in phase 3, so IPO is supposed to work "effectively" with PGO. What is the truth? And if both work at the same time, how do they work mutually?

Making a testcase for this looks difficult (it will need large files with many functions and many branches) so I am reluctant to make a testcase. If anyone provides an easy way to make a testcase or an example, it will be highly appreciated.

Optimization of ICC is very strong along with vectorization;the best for Intel processors, so still more I am interested in these features.

Thanks in advance.
0 Kudos
Maximillia_D_Intel
647 Views
The combination of IPO and PGO can typically be better than using one of the advanced optimizations alone. IPO enables inlining and with PGO, the compiler will know the most frequently called functions so that it can make a bang for buck tradeoff between inlining to reduce call return overhead and the code size increase associated with inlinine. No point inlining functions that are rarely called.
Max
0 Kudos
maverick6664
Beginner
647 Views
Thank you and sorry if it sounded argumentative.

Actually I usually use IPO when it's available (I mean, I use IPO except for in phase 1 of PGO.)

As you say, IPO determines inlining, and reading optimization documentation, I found it does more than PGO (alias analysis(I don't know what it means yet) for better vectorization, besides interprocedural optimization. PGO simply predicts branching, and analyzes code utilizations, relocates procedures to utilize cache/paging effectively.

regards,
0 Kudos
Manuel_P_
Beginner
647 Views
I did quite a lot of test with IPO, PGO, and vectorization.
My experience is that vectorization (/QxN) does a great job, but IPO and PGO brings nothing on top of that. Frankly, IPO and/or PGO slows down the code a bit.

My conclusion is that every software project is different. You have to find out yourself what the best optimization options are for your project.
Turning on some (or all) optimization features does not necessarily mean faster code.

Regards
Martin
0 Kudos
Reply