[all-commits] [llvm/llvm-project] 54e18b: [lld-macho] Optimize rebase opcode generation

Daniel Bertalan via All-commits all-commits at lists.llvm.org
Thu Jul 21 01:08:59 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 54e18b23972a3fb1756bd30729102034d376dda4
      https://github.com/llvm/llvm-project/commit/54e18b23972a3fb1756bd30729102034d376dda4
  Author: Daniel Bertalan <dani at danielbertalan.dev>
  Date:   2022-07-21 (Thu, 21 Jul 2022)

  Changed paths:
    M lld/MachO/SyntheticSections.cpp
    M lld/test/MachO/rebase-opcodes.s

  Log Message:
  -----------
  [lld-macho] Optimize rebase opcode generation

This commit reduces the size of the emitted rebase sections by
generating the REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB and
REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB opcodes.

With this change, chromium_framework's rebase section is a 40% smaller
197 kilobytes, down from the previous 320 kB. That is 6 kB smaller than
what ld64 produces for the same input.

Performance figures from my M1 Mac mini:

x before
+ after

    N           Min           Max        Median           Avg        Stddev
x  10     4.2269349     4.3300061     4.2689675     4.2690016   0.031151669
+  10      4.219331     4.2914009     4.2398136     4.2448277   0.023817308
No difference proven at 95.0% confidence

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




More information about the All-commits mailing list