[PATCH] D59902: [COFF] Optimize range extension thunk insertion memory usage

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 27 13:42:54 PDT 2019


rnk created this revision.
rnk added reviewers: mstorsjo, ruiu.
Herald added a project: LLVM.

This avoids allocating O(#relocs) of intermediate data for each section
when range extension thunks aren't needed for that section. This also
removes a std::vector from SectionChunk, which further reduces its size.

Instead, this change adds the range extension thunk symbols to the
object files that contain sections that need extension thunks. By adding
them to the symbol table of the parent object, that means they now have
a symbol table index. Then we can then modify the original relocation,
after copying it to read-write memory, to use the new symbol table
index.

This makes linking browser_tests.exe with no PDB 10.46% faster, moving
it from 11.364s to 10.288s averaged over five runs.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D59902

Files:
  lld/COFF/Chunks.cpp
  lld/COFF/Chunks.h
  lld/COFF/InputFiles.h
  lld/COFF/PDB.cpp
  lld/COFF/Writer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59902.192515.patch
Type: text/x-patch
Size: 9643 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190327/c5cc691e/attachment.bin>


More information about the llvm-commits mailing list