[PATCH] D105410: [lld-macho] Parse relocations quickly by assuming sorted order
Jez Ng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 4 13:10:24 PDT 2021
int3 created this revision.
int3 added a reviewer: lld-macho.
Herald added a reviewer: gkm.
Herald added a project: lld-macho.
int3 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
clang and gcc both seem to emit relocations in reverse order of
address. That means we can match relocations to their containing
subsections in `O(relocs + subsections)` rather than the `O(relocs *
log(subsections))` that our previous binary search implementation
required.
I also removed the `is_sorted()` assert in ConcatOutputSection, since we
are now checking that property at parse time.
Numbers for linking chromium_framework on my 3.2 GHz 16-Core Intel Xeon W:
N Min Max Median Avg Stddev
x 20 4.04 4.11 4.075 4.0775 0.018027756
+ 20 3.95 4.02 3.98 3.985 0.020900768
Difference at 95.0% confidence
-0.0925 +/- 0.0124919
-2.26855% +/- 0.306361%
(Student's t, pooled s = 0.0195172)
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D105410
Files:
lld/MachO/ConcatOutputSection.cpp
lld/MachO/InputFiles.cpp
lld/test/MachO/invalid/unsorted-relocations.yaml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105410.356394.patch
Type: text/x-patch
Size: 4778 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210704/71e019b1/attachment.bin>
More information about the llvm-commits
mailing list