[PATCH] D36351: [lld][ELF] Add profile guided section layout
Michael Spencer via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 7 15:18:21 PDT 2017
On Thu, Sep 7, 2017 at 2:16 PM, Rui Ueyama via Phabricator <
reviews at reviews.llvm.org> wrote:
> ruiu added a comment.
>
> How can I test this? I wonder how to create profiling data to feed this
> feature.
>
The way I've been doing it is using llvm's profile support as included in
the original RFC. This reduced patch was done to separate that out, but I
would expect most users that use PGO with an llvm toolchain would not be
using the text file method.
- Michael Spencer
>
>
>
> ================
> Comment at: ELF/Writer.cpp:927
> + if (!Config->CallGraphProfile.empty()) {
> + llvm::DenseMap<const InputSectionBase *, int> OrderMap =
> + computeCallGraphProfileOrder();
> ----------------
> Remove `llvm::`
>
>
> ================
> Comment at: ELF/Writer.cpp:930-936
> + for (BaseCommand *Base : Script->Opt.Commands) {
> + auto *OS = dyn_cast<OutputSection>(Base);
> + if (!OS || OS->Name != ".text")
> + continue;
> + OS->sort([&](InputSectionBase *IS) { return OrderMap.lookup(IS); });
> + break;
> + }
> ----------------
> for (BaseCommand *Base : Script->Opt.Commands)
> if (auto *OS = dyn_cast<OutputSection>(Base))
> if (OS->Name == ".text")
> OS->sort([&](InputSectionBase *IS) { return OrderMap.lookup(IS);
> });
>
>
> Repository:
> rL LLVM
>
> https://reviews.llvm.org/D36351
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170907/ac1962c4/attachment.html>
More information about the llvm-commits
mailing list