- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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”?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ron,
Did you have a chance to check my earlier response? Let me know if you have any further clarifications, appreciate much.
_Kittur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Ron, a pleasure to have answered your question.
_Kittur
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page