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

Andrew Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 14 01:56:16 PDT 2020


andrewng added inline comments.


================
Comment at: lld/ELF/ICF.cpp:228
     for (size_t i = begin; i < mid; ++i)
-      sections[i]->eqClass[next] = mid;
+      sections[i]->eqClass[next] = eqClass;
 
----------------
MaskRay wrote:
> andrewng wrote:
> > MaskRay wrote:
> > > Inline the variable `eqClass`
> > > 
> > Just to clarify, you want me to replace `eqClass` with the expression `eqClassBase + mid`, i.e. bring the addition inside the `for` loop?
> Yes. This is optimizable by the compiler
OK, no problem, although I have to admit this goes against my instinctive coding approach. But I guess that might be because most projects with which I've been involved, have put at least some importance towards the run-time performance of unoptimized debug builds. But if this is the "LLVM" way, then so be it.


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

https://reviews.llvm.org/D88830



More information about the llvm-commits mailing list