Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Ron_Green
Moderator
147 Views

Inlining of function pointer arguments to other functions

In the past, I’ve asked about what we can expect from IPO with the Intel compiler.  My take away from that was that we cannot expect Intel C++ to inline function pointer arguments to other functions when the two are in different translation units.

What about the case where both the caller and callee are in the same translation unit, and  we are compiling with just “–ip”?

0 Kudos
4 Replies
Kittur_G_Intel
Employee
147 Views

Hi Ron!
When the two are in different translation units, -ip will not be able to cause inlining to happen, but –ipo might be able to do so.  It all depends on whether it can resolve the indirect call to one or more targets, and predict profitably which of those targets are most likely to be called.  That said, the advise is for you to use -ipo. 
You should be able to look at the inlining report of the optimization report to see whether the func pointers were inlined or not. Note that the calls marked as external aren't candidates for inlining since they could be another translation unit etc.

_Cheers,
Kittur


 

Kittur_G_Intel
Employee
147 Views

Hi Ron,
Did you have a chance to check my earlier response? Let me know if you have any further clarifications, appreciate much.
_Kittur 

Ron_Green
Moderator
147 Views

that answered it.

 

functions referenced by pointers are not inlining candidates, as the pointer could potentially point to any function in the code and hence what would you inline? yes, this issue is closed.

 

 

 

Kittur_G_Intel
Employee
147 Views

Thanks Ron, a pleasure to have answered your question.
  _Kittur

Reply