[PATCH] D40238: [wip] COFF: Do not create SectionChunks for discarded comdat sections.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 19 23:50:09 PST 2017


pcc created this revision.
Herald added a subscriber: mehdi_amini.

With this change, instead of creating a SectionChunk for each section
in the object file, we only create them when we encounter a prevailing
comdat section.

Also change how symbol resolution occurs between comdat symbols. Now
only the comdat leader participates in comdat resolution, and not any
other external associated symbols. This is more in line with how COFF
semantics are defined, and should allow for a more straightforward
implementation of non-ANY comdat types.

On my machine, this change reduces our runtime linking a release
build of chrome_child.dll with /nopdb from 5.65s to 4.54s (median of
50 runs).

TODO:

- Fix interaction between LTO and comdats. This will require changes to how we represent comdats in the IR symbol table.

Depends on https://reviews.llvm.org/D40235

Depends on https://reviews.llvm.org/D40236

Depends on https://reviews.llvm.org/D40237


https://reviews.llvm.org/D40238

Files:
  lld/COFF/Chunks.cpp
  lld/COFF/Chunks.h
  lld/COFF/InputFiles.cpp
  lld/COFF/InputFiles.h
  lld/COFF/MarkLive.cpp
  lld/COFF/SymbolTable.cpp
  lld/COFF/SymbolTable.h
  lld/COFF/Symbols.h
  lld/test/COFF/reloc-discarded.s
  llvm/include/llvm/Object/COFF.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40238.123543.patch
Type: text/x-patch
Size: 21599 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171120/09d76969/attachment.bin>


More information about the llvm-commits mailing list