[all-commits] [llvm/llvm-project] 2515cb: [ELF] Parallelize input section initialization

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Aug 4 11:48:06 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2515cb80cd3ba3bcead6ec2f1f30437cc2d325d5
      https://github.com/llvm/llvm-project/commit/2515cb80cd3ba3bcead6ec2f1f30437cc2d325d5
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-08-04 (Thu, 04 Aug 2022)

  Changed paths:
    M lld/ELF/Driver.cpp
    M lld/ELF/InputFiles.cpp
    M lld/ELF/InputFiles.h
    M lld/ELF/InputSection.cpp

  Log Message:
  -----------
  [ELF] Parallelize input section initialization

This implements the last step of
https://discourse.llvm.org/t/parallel-input-file-parsing/60164 for the ELF port.

For an ELF object file, we previously did: parse, (parallel) initializeLocalSymbols, (parallel) postParseObjectFile.
Now we do: parse, (parallel) initSectionsAndLocalSyms, (parallel) postParseObjectFile.

initSectionsAndLocalSyms does most of input section initialization.
The sequential `parse` does SHT_ARM_ATTRIBUTES/SHT_RISCV_ATTRIBUTES/SHT_GROUP initialization for now.

Performance linking some programs with --threads=8 (glibc 2.33 malloc and mimalloc):

* clang: 1.05x as fast with glibc malloc, 1.03x as fast with mimalloc
* chrome: 1.04x as fast with glibc malloc, 1.03x as fast with mimalloc
* internal search program: 1.08x as fast with glibc malloc, 1.05x as fast with mimalloc

Reviewed By: peter.smith

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




More information about the All-commits mailing list