[PATCH] D128382: [LLD] Two tweaks to symbol ordering scheme

YongKang Zhu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 11 22:22:53 PDT 2022


yozhu added inline comments.


================
Comment at: lld/ELF/Writer.cpp:1368
+  if (executableOutputSection && target->getThunkSectionSpacing() &&
+      !orderedSections.empty() &&
+      totalSize >= target->getThunkSectionSpacing()) {
----------------
MaskRay wrote:
> it's more natural to place two `target->getThunkSectionSpacing()` together.
It is kind of to do cheaper (equal or not equal to zero) checks first and then do relatively more expensive (comparing two 64-bit integers) check.  But I can swap the 2nd and 3rd checks; it likely doesn't matter that much.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128382



More information about the llvm-commits mailing list