[PATCH] D44969: ELF: Place ordered sections in the middle of the unordered section list on targets with limited-range branches.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 30 11:13:38 PDT 2018


ruiu added a comment.

I don't think I understand why this patch can reduce size of generated executables. This may increase performance because we use short branches to jump to hot functions, but how can it reduce the size of thunks?



================
Comment at: lld/ELF/Writer.cpp:1088
 
+static void
+sortISDBySectionOrder(InputSectionDescription *ISD,
----------------
Can you add a comment?


================
Comment at: lld/ELF/Writer.cpp:1091
+                      const DenseMap<const InputSectionBase *, int> &Order) {
+  std::vector<InputSection *> UnorderedSections, OrderedSections;
+  uint64_t UnorderedSize = 0;
----------------
nit: I'd write it in two lines.


https://reviews.llvm.org/D44969





More information about the llvm-commits mailing list