[all-commits] [llvm/llvm-project] 718c32: [lld-macho] Only emit one BIND_OPCODE_SET_SYMBOL p...

Jez Ng via All-commits all-commits at lists.llvm.org
Mon Jul 5 17:00:44 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 718c32175b3bcced88d9ca25ab1482a682ae5bbb
      https://github.com/llvm/llvm-project/commit/718c32175b3bcced88d9ca25ab1482a682ae5bbb
  Author: Jez Ng <jezng at fb.com>
  Date:   2021-07-05 (Mon, 05 Jul 2021)

  Changed paths:
    M lld/MachO/SyntheticSections.cpp
    M lld/MachO/SyntheticSections.h
    A lld/test/MachO/bind-opcodes.s

  Log Message:
  -----------
  [lld-macho] Only emit one BIND_OPCODE_SET_SYMBOL per symbol

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.

This change is perf-neutral when linking chromium_framework.

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D105075




More information about the All-commits mailing list