<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Sep 7, 2017 at 2:16 PM, Rui Ueyama via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">ruiu added a comment.<br>
<br>
How can I test this? I wonder how to create profiling data to feed this feature.<br></blockquote><div><br></div><div>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.</div><div><br></div><div>- Michael Spencer<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
<br>
================<br>
Comment at: ELF/Writer.cpp:927<br>
+  if (!Config->CallGraphProfile.<wbr>empty()) {<br>
<span class="gmail-">+    llvm::DenseMap<const InputSectionBase *, int> OrderMap =<br>
+        computeCallGraphProfileOrder()<wbr>;<br>
----------------<br>
</span>Remove `llvm::`<br>
<br>
<br>
================<br>
Comment at: ELF/Writer.cpp:930-936<br>
<span class="gmail-">+    for (BaseCommand *Base : Script->Opt.Commands) {<br>
+      auto *OS = dyn_cast<OutputSection>(Base);<br>
+      if (!OS || OS->Name != ".text")<br>
+        continue;<br>
</span>+      OS->sort([&](InputSectionBase *IS) { return OrderMap.lookup(IS); });<br>
+      break;<br>
+    }<br>
----------------<br>
<span class="gmail-">    for (BaseCommand *Base : Script->Opt.Commands)<br>
</span>      if (auto *OS = dyn_cast<OutputSection>(Base))<br>
        if (OS->Name == ".text")<br>
<span class="gmail-im gmail-HOEnZb">          OS->sort([&](InputSectionBase *IS) { return OrderMap.lookup(IS); });<br>
<br>
<br>
</span><div class="gmail-HOEnZb"><div class="gmail-h5">Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D36351" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D36351</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div></div>