[PATCH] D116093: [ELF] Avoid referencing SectionBase::repl after ICF

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 21 01:16:15 PST 2021


MaskRay created this revision.
MaskRay added reviewers: andrewng, ikudrin, peter.smith.
Herald added subscribers: arichardson, emaste.
MaskRay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

It is fairly easy to forget SectionBase::repl after ICF.
Let ICF rewrite a Defined symbol's `section` field to avoid references to
SectionBase::repl in subsequent passes. This slightly improves the performance
due to less indirection (definitely for --icf=none, maybe for --icf={safe,all}
if most symbols are Defined).

With this change, there is only one reference to `repl` for --gdb-index (D89751 <https://reviews.llvm.org/D89751>).
We can undo f4fb5fd7523f8e3c3b3966d43c0a28457b59d1d8 (`Move Repl to SectionBase.`).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116093

Files:
  lld/ELF/CallGraphSort.cpp
  lld/ELF/ICF.cpp
  lld/ELF/InputSection.cpp
  lld/ELF/InputSection.h
  lld/ELF/Relocations.cpp
  lld/ELF/Symbols.cpp
  lld/ELF/Symbols.h
  lld/ELF/SyntheticSections.cpp
  lld/ELF/Writer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116093.395619.patch
Type: text/x-patch
Size: 8751 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211221/ec4d0be8/attachment.bin>


More information about the llvm-commits mailing list