[LLVMdev] Call profiling and function placement in object file

Gratian Lup lgratian at gmail.com
Fri Mar 11 03:53:51 PST 2011


Hi!
I'm interested in profile-guided optimizations and was looking at the
functionality LLVM provides. I have two questions:

- can the current (optimal) edge profiling be used to determine the number
of times a function calls another one? I need to know not only how many
times a function was called, but also by whom. Or to say in in a different
way, can a profile edge be formed from blocks originating from different
functions? I need this information so that I cluster the functions based on
the call frequency and the relationship between them.

- is there a way to force the linker to place the functions in a specific
order in the object file? I mean something like associating a number with
each function, and the linker placing the functions ordered by these
numbers. The assigned number would be the ID of the cluster in which the
function is found.
If this is not possible the only idea left would be to place the functions
in different sections, but that would interfere with directives written by
the user in the source files.

Thanks in advance,
Gratian

PS: It's probably clear that I want to implement a function placement
optimization like the one described by Pettis & Hansen.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110311/8510c646/attachment.html>


More information about the llvm-dev mailing list