[PATCH] D36351: [lld][ELF] Add profile guided section layout

Rafael Avila de Espindola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 12 08:39:44 PDT 2018


espindola added inline comments.


================
Comment at: ELF/CallGraphSort.cpp:32
+///
+/// It does so given a call graph profile by the following:
+/// * Build a weighted call graph from the profile
----------------
Bigcheese wrote:
> espindola wrote:
> > The part about profile should be in a followup patch. For now this is given the weighted call graph.
> This is talking about the for loop in `CallGraphSort()` where it builds the graph.
Building a graph from a set of edges doesn't sound much, but it is OK to keep the comment. Just don't use the word profile as it makes it sound like lld is reading the direct output of perf or similar.



================
Comment at: ELF/CallGraphSort.cpp:203
+    } else
+      Edges[EI].Weight += Weight;
+  }
----------------
This is not tested. All tests pass if I replace it with an assert.


https://reviews.llvm.org/D36351





More information about the llvm-commits mailing list