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

Annotated source listing for template

bungeetux
Beginner
434 Views
I use /Qopt-report-annotate to annotate source files with optimisation reporting. It's very useful and simple to use. I go directly to the part that I know is slow and I read what the compiler have done. Nonetheless when there is template code (in a header file), we have no annotated file for each template instantiation. The information is available via /Qopt-report:3 but then we have to go back and forth between the header file and the optrpt file to verify each optimisation. Is there any option to have also these template annotated. Such a feature will be greatly appreciated.
0 Kudos
1 Solution
jimdempseyatthecove
Honored Contributor III
434 Views

You are assuming that all template expansions produce the same (optimized) code. This assumption is incomplete. A similar circumstance exists with optimization of inline functions. Each instance of either may be unique.

Jim Dempsey

View solution in original post

0 Kudos
3 Replies
jimdempseyatthecove
Honored Contributor III
435 Views

You are assuming that all template expansions produce the same (optimized) code. This assumption is incomplete. A similar circumstance exists with optimization of inline functions. Each instance of either may be unique.

Jim Dempsey

0 Kudos
bungeetux
Beginner
434 Views
For sure template expansions produce different optimize code. A quick view of inline functions or template code with annotations in the destination file will be more explicit than to review the complete report where the information is spreaded. But I understand that template instantiation produce a lot of possibilities so it is perhaps non desirable. Benoit
0 Kudos
jimdempseyatthecove
Honored Contributor III
434 Views

I haven't done this personally, what may be of use is to place identifying comments at the beginning and end of the template, then generate assembly output with source. You should then be able to write a filter program that excises everything but the template/inline function instances. Then looking at what remains may be of some use.

Jim Dempsey

0 Kudos
Reply