[PATCH] D106212: [lld-macho] ICF: Do more work in equalsConstant, less in equalsVariable
Jez Ng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 16 23:41:07 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.
In particular, relocations to absolute symbols or literal sections can
be handled in equalsConstant(), since their output addresses will not
change across each iteration of ICF. Offsets and addends can also be
dealt with entirely in equalsConstant(), making the code somewhat easier
to reason about. Only ConcatInputSections need to be handled in
equalsVariable().
LLD-ELF's implementation takes a similar approach.
Although this should make ICF do less work, in practice it seems like
there is no stat sig difference in time taken when linking
chromium_framework.
This refactor is motivated by an upcoming diff which improves ICF's handling of
addends.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D106212
Files:
lld/MachO/ICF.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106212.359536.patch
Type: text/x-patch
Size: 6227 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210717/1e07ab71/attachment.bin>
More information about the llvm-commits
mailing list