[PATCH] D88830: [LLD][ELF] Improve ICF for relocations to ineligible sections via "aliases"

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 7 14:40:25 PDT 2020


MaskRay added inline comments.


================
Comment at: lld/ELF/ICF.cpp:226
+    // Add this to eqClassBase to avoid equality with unique IDs.
+    uint32_t eqClass = eqClassBase + mid;
     for (size_t i = begin; i < mid; ++i)
----------------
How about making uniqueId in the main function start from `inputSections.size()`. The variable `eqClassBase` can be avoided. 

There is a gap between used values but that is not a problem: `[0, sections.size()) ... [inputSections.size(), inputSections.size()+sections.size())`


================
Comment at: lld/test/ELF/icf-ineligible.s:1
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
----------------
You can delete icf-non-mergeable.s by adding some lines to this file.


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

https://reviews.llvm.org/D88830



More information about the llvm-commits mailing list