[PATCH] D105075: [lld-macho] Only emit one BIND_OPCODE_SET_SYMBOL per symbol
Jez Ng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 28 19:54:43 PDT 2021
int3 created this revision.
int3 added a reviewer: lld-macho.
Herald added a subscriber: mgrang.
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.
Size-wise, BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM is the most
expensive opcode, since it comes with an associated symbol string. We
were previously emitting it once per binding, instead of once per
symbol. This diff groups all bindings for a given symbol together and
ensures we only emit one such opcode per symbol. This matches ld64's
behavior.
While this is a relatively small win on chromium_framework (-72KiB), for
programs that have more dynamic bindings, the difference can be quite
large.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D105075
Files:
lld/MachO/SyntheticSections.cpp
lld/MachO/SyntheticSections.h
lld/test/MachO/bind-opcodes.s
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105075.355095.patch
Type: text/x-patch
Size: 11260 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210629/8ecc40f8/attachment.bin>
More information about the llvm-commits
mailing list