[PATCH] D36351: [lld][ELF] Add profile guided section layout
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 7 14:16:41 PDT 2017
ruiu added a comment.
How can I test this? I wonder how to create profiling data to feed this feature.
================
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
More information about the llvm-commits
mailing list