[PATCH] D45548: Avoid hash table lookup when sorting local symbols.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 11 17:52:51 PDT 2018


ruiu created this revision.
ruiu added reviewers: espindola, grimar.
Herald added subscribers: arichardson, emaste.

Looking up a hash table for each symbol should be avoided for
performance reasons. In this patch, I assign a unique ID to each
file and use that number to sort symbols.

The other way of doing this would be to use object addresses of files,
but that algorithm fails to make output reproducible. So I had to
add `FileId` member to InputFile class.


https://reviews.llvm.org/D45548

Files:
  lld/ELF/InputFiles.cpp
  lld/ELF/InputFiles.h
  lld/ELF/SyntheticSections.cpp
  lld/test/ELF/local-symbols-order.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45548.142102.patch
Type: text/x-patch
Size: 4624 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180412/38ebae6d/attachment.bin>


More information about the llvm-commits mailing list