[PATCH] D117354: [lld-macho] Allow order files and call graph sorting to be used together

Leonard Grey via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 28 06:56:47 PST 2022


lgrey added inline comments.


================
Comment at: lld/MachO/SectionPriorities.cpp:376
       return;
-
-    SymbolPriorityEntry &entry = it->second;
-    size_t &priority = sectionPriorities[sym.isec];
-    priority =
-        std::max(priority, getSymbolPriority(entry, sym.isec->getFile()));
+    size_t &priority = sectionPriorities[sym->isec];
+    priority = std::max(priority, symbolPriority.getValue());
----------------
thakis wrote:
> When does this return non-0? The call graph order omits edges where either start or end have a priority from the order file, so it can only happen if two distinct symbols have the same isec, right? Does this run after ICF? Are there things other than ICF that could trigger it?
In the absence of call graph sorting, this is the same logic as currently unless I broke something. I'll get back to you about ICF, but there's N_ALT_ENTRY (also theoretically a problem if there are multiple symbols via N_ALT_ENTRY and one is an order file and another has a CG edge; I think this is rare and mostly covered by order file priorities being higher).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117354/new/

https://reviews.llvm.org/D117354



More information about the llvm-commits mailing list