[all-commits] [llvm/llvm-project] a8843e: [lld-macho] Parallelize linker optimization hint p...

Daniel Bertalan via All-commits all-commits at lists.llvm.org
Fri Sep 16 08:39:29 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a8843ec95295a927d3f31719cec4b6bcefb90844
      https://github.com/llvm/llvm-project/commit/a8843ec95295a927d3f31719cec4b6bcefb90844
  Author: Daniel Bertalan <dani at danielbertalan.dev>
  Date:   2022-09-16 (Fri, 16 Sep 2022)

  Changed paths:
    M lld/MachO/Arch/ARM64.cpp
    M lld/MachO/InputFiles.cpp
    M lld/MachO/InputFiles.h
    M lld/MachO/InputSection.cpp
    M lld/MachO/InputSection.h
    M lld/MachO/Relocations.h
    M lld/MachO/Target.h
    M lld/MachO/Writer.cpp
    M lld/test/MachO/invalid/invalid-loh.s
    M lld/test/MachO/loh-adrp-adrp.s

  Log Message:
  -----------
  [lld-macho] Parallelize linker optimization hint processing

This commit moves the parsing of linker optimization hints into
`ARM64::applyOptimizationHints`. This lets us avoid allocating memory
for holding the parsed information, and moves work out of
`ObjFile::parse`, which is not parallelized at the moment.

This change reduces the overhead of processing LOHs to 25-30 ms when
linking Chromium Framework on my M1 machine; previously it took close to
100 ms.

There's no statistically significant change in runtime for a --threads=1
link.

Performance figures with all 8 cores utilized:

      N           Min           Max        Median           Avg        Stddev
  x  20     3.8027232     3.8760762     3.8505335     3.8454145   0.026352574
  +  20     3.7019017     3.8660538     3.7546209     3.7620371   0.032680043
  Difference at 95.0% confidence
  	-0.0833775 +/- 0.019
  	-2.16823% +/- 0.494094%
  	(Student's t, pooled s = 0.0296854)

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




More information about the All-commits mailing list