[llvm-dev] [RFC] Profile guided section layout

Tobias Edler von Koch via llvm-dev llvm-dev at lists.llvm.org
Mon Jul 31 15:15:21 PDT 2017

On 07/31/2017 05:11 PM, Rafael Avila de Espindola wrote:
>> The advantage of the proposed approach (weighted callgraph section) is
>> that it's completely transparent: it works regardless of the particular
>> profiling methodology (as long as there's !perf metadata when the pass
>> runs). For this reason, it fits neatly into an *existing* PGO-based
>> build flow. I only need to add 1 compiler flag to enable it. That's a
>> big plus.
>> On the other hand, I could see how your idea (callgraph input file for
>> linker) would be useful in situations where I just want to do section
>> layout but no PGO in the compiler... and of course for testing of the
>> linker's sorting algorithm.
>> So there's merits in both, but for my use cases Michael's original
>> approach is the most practical.
> Yes, I must stress that I am not proposing having the option of reading
> the callgraph from another file *instead* of reading it from .o
> files. Just that doing it first decouples most of the lld patch form the
> llvm changes and can be useful in cases where only samples are available.


Michael/Rafael, would you mind uploading the patches to Phabricator so 
people can review them there? I think there is enough interest in this 
feature to move towards merging it in tree.


Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

More information about the llvm-dev mailing list