[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 21:32:59 PDT 2018


espindola added inline comments.


================
Comment at: ELF/CallGraphSort.cpp:198
+// probibility.
+void CallGraphSort::normalizeEdgeWeights() {
+  for (int SI = 0, SE = Sections.size(); SI != SE; ++SI) {
----------------
Instead of storing a normalized edge value it is simpler to store the original cluster weight: https://reviews.llvm.org/D45607


================
Comment at: ELF/CallGraphSort.cpp:257
+
+    if (BestWeight < MIN_EDGE_PROBABILITY)
+      continue;
----------------
This is not tested.

This is not in the paper, right? Do you know what is the motivation? It is interesting in that the algorithm prioritizes hot nodes, but has a limit on how cold an edge can be.

It does seem to have a small performance win, at lest on the LTOing FileCheck testcase. With this patch a run takes 2.519023951 seconds, with this check removed it takes 2.520792327 (no sorting is 2.575764375).



https://reviews.llvm.org/D36351





More information about the llvm-commits mailing list