Inter-Procedural Optimization(IPO) - Optimizations options flexibility

Inter-Procedural Optimization(IPO) - Optimizations options flexibility

Hello,

While going through "Intel C++ Optimizing Applications" document (304968-022US), Pg#156-157 on InterProcedural Optimizations section, I see lots of optionsbeing called internally when using"-ipo"for multi-file optimizations using ICC-v11.0 moreover the document simply says use IPO as calling through compiler driver for multi-file as "$icpc -ipo -o hello hello.cc hello-1.cc hello-2.cc", the ICC does all jobs related with IPO internally for you, assuming it does really.

The IPO options listed are -
-----
constant propagation
mod/ref analysis
alias analysis
forward substitution
routine key-attribute propagation
address-taken analysis
partial dead call elimination
symbol table data promotion
common block variable coalescing
dead function elimination
unreferenced variable removal
whole program analysis
array dimension padding
common block splitting
stack frame alignment
structure splitting and field reordering
formal parameter alignment analysis
C++ class hierarchy analysis
indirect call conversion
specialization
---

Themulti-file may not have a sinerio to use all above listed IPO options, does ICC gives flexibity of selecting the options (couldbe the needed one as OFF/ON)innovatively as per design of section of code/API within multi-file IPO optimization techniques for better peak performance with IPO?

It could be thatCompiler in the first shot/pass would be collecting the summary of techniques of IPO needed to performed for the multi-file procedure or routines,is thecompiler being bothered heavily by generating such summary reports in first pass of multi-file and thanin second pass allowed to perform IPO, why not have theflexibity of IPO options to help developers in selecting the needed IPO option(s) to tune applications for higher performance?

~BR
Mukkaysh Srivastav

15 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The users do not have the flexibility to enable or disable internal optimization steps in IPO. The optimization are appplied sequentially based on internal data structure genered for the source code.

Quoting - Om Sachan (Intel)

The users do not have the flexibility to enable or disable internal optimization steps in IPO. The optimization are appplied sequentially based on internal data structure genered for the source code.

I think users should have the facility to select IPO option as needed with valid reason what I gave above.

Some compilers do have this feature, if I can recall probably, PathScale Compilers has these facility of selecting the options within it's IPO.

~BR

You may make a feature request to Intel compiler team explaining how this feature will help the compiler users.

I'll check if such option is possible.

But do you want an option for all the listed optimizations under ipo? Or several ones are specifically?If so, please list those.

Jennifer

Quoting - Om Sachan (Intel)

You may make a feature request to Intel compiler team explaining how this feature will help the compiler users.

I think the Front-End of Intel Compiler has to be looked what could be the good candidature for above features options and somewhat SSA has to be touched too for further optimizations.

Probably, working with Compiler Team would make more sense and redesigning it independently for IPO.

~BR

Quoting - Jennifer Jiang (Intel)

I'll check if such option is possible.

But do you want an option for all the listed optimizations under ipo? Or several ones are specifically?If so, please list those.

Jennifer

I think the decision has to be taken by the Compiler team with existing Frond-End (FE) they have done to support IPO. Atleast it should be done in phased manner gradually.

I think some switch cases has to be defined within IPO Front-End files to handle such features IF-Else, etc. and finally performing CFG for all these selected IPO within SSA but the better knowledge & design aspects the FE Compiler Team would be having.

Something, which strikes me as critical are -
- array dimension padding
- common block splitting
- structure splitting and field reordering
- C++ class hierarchy analysis
- whole program analysis

~BR

A particular (annoying) problem I have found with IPO is on my development system I create, enhance and maintain a tool (contained in a .lib file). On the same system I write test applicaitons. The users of the eventual software will not have the sources of my library. However, back on my development system, I cannot compile the test applicaion with IPO enabled .AND. _without_ the compiler reaching into the sourcesused to buildmy .lib file for performing the IPO on the test app.

End-users will tend to have IPO enabled. Therefore I cannot use my development/support system to reproduce the problem. The resultant code is "contaminated" with optimizations (not available on the end-user system).

The IPO needs to have something analogous to the Linker properties page to specify files to ignore in link. i.e. what is needed is an "Ignore files and/or ignore files within .lib/.dll and/or Projects and/or Solutionsin IPO analysis". And an additional option "IPO is restricted to source files within project" i.e. have an option to inhibit inter-project IPO optimizations.

Jim Dempsey

www.quickthreadprogramming.com

Quoting - jimdempseyatthecove

A particular (annoying) problem I have found with IPO is on my development system I create, enhance and maintain a tool (contained in a .lib file). On the same system I write test applicaitons. The users of the eventual software will not have the sources of my library. However, back on my development system, I cannot compile the test applicaion with IPO enabled .AND. _without_ the compiler reaching into the sourcesused to buildmy .lib file for performing the IPO on the test app.

End-users will tend to have IPO enabled. Therefore I cannot use my development/support system to reproduce the problem. The resultant code is "contaminated" with optimizations (not available on the end-user system).

The IPO needs to have something analogous to the Linker properties page to specify files to ignore in link. i.e. what is needed is an "Ignore files and/or ignore files within .lib/.dll and/or Projects and/or Solutionsin IPO analysis". And an additional option "IPO is restricted to source files within project" i.e. have an option to inhibit inter-project IPO optimizations.

Jim Dempsey

I agree this would be a problem, but I could not duplicate it.

Here is what I did:
1. create a lib1 project, and build "release" using icl (/Qipo enabled)
2. create a new main project that uses "lib1.lib".
a. copy "lib1.lib" to directory of main.sln
b. rename lib1 project directory
c. build main project "release" (/Qipo enabled) without problem.
**** it builds fine. ****

Could you see what I is wrong with my steps?

Jennifer

On the system where this appears to be a problem (was running 11.0.066) it would compile, then Link, then Link would call compiler again (which I thought was odd). It is behaving as if the linker, when locating an .obj file ina .lib does a call back to the compiler to ask "can you find this file for use in IPO", if found, perform new compile with merge into application. i.e. the .obj in the .lib container is NOT linked in, rather a freshly re-constituded and co-mingled copy is brought in (and possibly inlined). This makes it impossible to perform regression testing with a .lib file built on the same system. I will be installing 11.0.074 tomorrow and see if that changes things.

Jim Dempsey

www.quickthreadprogramming.com

Quoting - jimdempseyatthecove

then Link would call compiler again (which I thought was odd). It is behaving as if the linker, when locating an .obj file ina .lib does a call back to the compiler to ask "can you find this file for use in IPO", if found, perform new compile with merge into application. i.e. the .obj in the .lib container is NOT linked in, rather a freshly re-constituded and co-mingled copy is brought in (and possibly inlined).

When passing /Qipo, the linker will call the compiler again to read the .obj or .lib to do ipo optimization, but it does not require the source code..

Quoting - jimdempseyatthecove

This makes it impossible to perform regression testing with a .lib file built on the same system. 

Could you specify the regression testing? what is it based on?

For IPO to work, the .lib and the application should be using the same compiler.

Jennifer

Quoting - srimks

I think the decision has to be taken by the Compiler team with existing Frond-End (FE) they have done to support IPO. Atleast it should be done in phased manner gradually.

I think some switch cases has to be defined within IPO Front-End files to handle such features IF-Else, etc. and finally performing CFG for all these selected IPO within SSA but the better knowledge & design aspects the FE Compiler Team would be having.

Something, which strikes me as critical are -
- array dimension padding
- common block splitting
- structure splitting and field reordering
- C++ class hierarchy analysis
- whole program analysis

~BR

After talking to our compiler engineer, I realized how difficult it is to provide options with this level of fine-grained control.

We support over 40 different interprocedural optimizations. We have a commitment to our customer base to provide a product that works reliably on all publicly supported option combinations. It's beyond our capabilities to test the 2**40 > 1 trillion option combinations individually.

Sorry that we can not provide such options. Even with only 5 new external options, it's still very expensive.

Jennifer

Quoting - Jennifer Jiang (Intel)

After talking to our compiler engineer, I realized how difficult it is to provide options with this level of fine-grained control.

We support over 40 different interprocedural optimizations. We have a commitment to our customer base to provide a product that works reliably on all publicly supported option combinations. It's beyond our capabilities to test the 2**40 > 1 trillion option combinations individually.

Sorry that we can not provide such options. Even with only 5 new external options, it's still very expensive.

Jennifer

Could you list down 40 different IPO schemes. Maybe, I can know those 40 IPO names and list down test cases for those myself...as I am trying to analyze Intel C++ Compiler IPO effectiveness currently.

If you don't wish to share on ISN can you send the list to "srimks11@gmail.com".

~BR

Quoting - Jennifer Jiang (Intel)

When passing /Qipo, the linker will call the compiler again to read the .obj or .lib to do ipo optimization, but it does not require the source code..

Quoting - jimdempseyatthecove

This makes it impossible to perform regression testing with a .lib file built on the same system. 

Could you specify the regression testing? what is it based on?

For IPO to work, the .lib and the application should be using the same compiler.

Jennifer

Jennifer,

By regression testing I mean compiling sample code that uses my toolset, on the system that contains the sources of my tool set (either Debug or Release version of by tool set), while performing permutations of the compiler optimization options on the sample code (trying to reproduce customer failure mode). These options would include IPO. When compiling sample code using my tool kit (in my .lib or .dll where end-user systems will not have the source code), I do not want IPO reaching in to those source files as the resultant execuitable will NOT be the same as (or close enought to that)produced on an end-user site.

Having options that say:

Exclude from IPO: ____(file.cpp, header.h, other.qqq, projects, solutions, xxx.lib, yyy.dll)
Include into IPO: _____(same list)

Would sort things out

BTW I installed 11.0.074 and the problem still persists (11.0.074 compilesmuch faster than 11.0.066)

Jim Demspey

www.quickthreadprogramming.com

Quoting - srimks

Could you list down 40 different IPO schemes. Maybe, I can know those 40 IPO names and list down test cases for those myself...as I am trying to analyze Intel C++ Compiler IPO effectiveness currently.

The documentation listed some ~20 items. It's pretty difficult to provide all the details because they're changing all the time.

Jennifer

Leave a Comment

Please sign in to add a comment. Not a member? Join today