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

Compiler Optimizations (Settings)

Florian_L_1
Beginner
446 Views

Hello there,

I'm wondering why for example, "Interprocedural Optimizations" aren't enabled by default since they include important things like "dead call deletion" / "inlining" / whole program analysis. Why so?

On the other hand im wondering what compiler settings I should use, to get maximum out of it. // for windows

Should I set O3 / Interprocedural Optimizations / Loop Unrolling ?

 

Thanks a lot!

0 Kudos
3 Replies
Varsha_M_Intel
Employee
446 Views

Hi Florian,

If you are using Visual studio for your application, then ipo is enabled by default.
Any optimization is dependent on the nature of the application. Turning on ipo for the entire application, can lead to increase in the binary and in some cases degrade the performance. 

Regarding the ideal optimization, O3 is the highest level of optimization and it does loop unrolling as well. But again, it depends on your application. You can refer the below article to choose the optimization based on nature of your application.

https://software.intel.com/en-us/articles/step-by-step-optimizing-with-intel-c-compiler

Thanks,
Varsha

 

0 Kudos
Florian_L_1
Beginner
446 Views
Thanks! I have converted 2 projects from vc++ to icc but ipo was disabled on both by default. Whats the difference between interprocedural optimization under c++ optimizations (single file, Multi file) and the one in the linker settings, that can be set only to on or off. Do I need to set both ? Thanks !
0 Kudos
TimP
Honored Contributor III
446 Views

IPO can be turned off for link if there are no object files built with IPO. Then (on linux) it's also possible to use the generic gnu object library tools, or (on Windows) it's possible to link with only Microsoft link.

Single file IP can be accomplished without generating IPO objects.  It's normally on by default for command line even without IPO set (in VS GUI, you can check the properties to see if it appears to be set).

A limited amount of inner loop unrolling is set by default.  In my experience, only for AVX (or some non-vectorizable cases) is it useful to raise the level to /Qunroll:4.

0 Kudos
Reply