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”?
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.
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.