[PATCH] D22825: Add a counter-function insertion pass

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 19:30:47 PDT 2016


hfinkel added a comment.

In https://reviews.llvm.org/D22825#497099, @honggyu.kim wrote:

> And I think we should consider `-finstrument-functions` option as well. It inserts two functions both at the entry and exit. We maybe better to change the name 'CountingFunction' to something else to cover both cases. 'CountingEntryFunction' and 'CountingExitFunction' seems to be okay as well.


No, those are different. They're supposed to be duplicated upon inlining. The GCC manual says:

"This instrumentation is also done for functions expanded inline in other functions. The profiling calls will indicate where, conceptually, the inline function is entered and exited. This means that addressable versions of such functions must be available. If all your uses of a function are expanded inline, this may mean an additional expansion of code size. If you use `extern inline' in your C code, an addressable version of such functions must be provided."

So these can be be inserted in the frontend as they are now.


https://reviews.llvm.org/D22825





More information about the llvm-commits mailing list