[PATCH] D131247: [ELF] Parallelize writes of different OutputSections

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 11 11:27:09 PDT 2022


MaskRay added a comment.

Appreciate the testing.

Some `parallel*` in SyntheticSections.cpp (e.g. `MergeNoTailSection::writeTo`) is now serial due to limitation of llvm/Support/Parallel.h, e.g. GdbIndexSection::writeTo, MergeNoTailSection::writeTo. Sometimes overlapping their write with other output sections is better than spending all threads in parallelizing them.

In case it is useful, I have tried parallel outputsection write last year (https://reviews.llvm.org/D116282). I don't find strict improvement so that patch stays the preview state.
The `shouldParallel` function there may be useful.

Also, --time-trace may be useful.

  ld.lld --time-trace --threads=8 @response.txt -o 1
  jq -r '.traceEvents[] | select(.name|contains("Write")) | "\(.dur/1000000) \(.name) \(.args)"' < 1.time-trace


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131247/new/

https://reviews.llvm.org/D131247



More information about the llvm-commits mailing list