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

Justin Bogner via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 1 14:40:07 PDT 2017


Michael Spencer <bigcheesegs at gmail.com> writes:
> On Tue, Aug 1, 2017 at 1:57 PM, Justin Bogner <mail at justinbogner.com> wrote:
>> Rafael Avila de Espindola via llvm-dev <llvm-dev at lists.llvm.org> writes:
>> > Since the branch frequency info is in a llvm specific format, it makes
>> > sense for llvm to read it instead of expecting lld to do it again. Since
>> > .o files is how the compiler talks to the linker, it also makes sense
>> > for llvm to record the required information there.
>> >
>> > In the same way, since the linker is the first place with global
>> > knowledge, it makes sense for it to be the one that implements a section
>> > ordering heuristic instead of just being told by some other tool, which
>> > would complicate the build.
>> >
>> > However, do we need to start with instrumentation? The original paper
>> > uses sampling with good results and current intel cpus can record every
>> > branch in a program.
>>
>> This already works without instrumentation. You can probably try it out
>> as is with profiles generated with linux perf using the create_llvm_prof
>> tool from the autofdo work: https://github.com/google/autofdo
>
> I'm pretty sure by "start with instrumentation" he means start with the
> restrictions it imposes on having to traffic the data through the object
> file.

Ah, that makes sense. Sorry, the word instrumentation is a little
overloaded.


More information about the llvm-dev mailing list