[PATCH] D103292: [lld-macho] Implement ICF

Greg McGary via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 9 12:17:09 PDT 2021


gkm added a comment.

In D103292#2808544 <https://reviews.llvm.org/D103292#2808544>, @int3 wrote:

>> Yes, that's the place it's really used. Does that use justify the .75% overhead? The alternative is making an isec-to-defined map when isec->icfEquivalenceClass & (1ull << 63) .
>
> Do the other LLD backends deal with a similar problem, or is this unique to us/Mach-O's format?

ELF and COFF add the member `InputSection *repl` to their input sections. Among a collection of duplicate sections, the dead ones point to the live one. There is no getting around that. The only thing unique about MachO is that dead sections indirect through a defined symbol to reference the live section. I did this for the sake of debugging. I can remove that indirection though and make dead input sections point directly to the live input section. However, there is no away around adding that one pointer to `InputSection` so that the dead sections can reference the live section.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103292



More information about the llvm-commits mailing list