[PATCH] D133003: [ELF] Parallelize relocation scanning
Andrew Ng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 10 11:23:20 PDT 2022
andrewng added inline comments.
================
Comment at: lld/ELF/Relocations.cpp:1566-1571
for (Partition &part : partitions) {
for (EhInputSection *sec : part.ehFrame->sections)
scanner.template scanSection<ELFT>(*sec);
if (part.armExidx && part.armExidx->isLive())
for (InputSection *sec : part.armExidx->exidxSections)
scanner.template scanSection<ELFT>(*sec);
----------------
This is running on the main thread. Is there a chance that this might clash with thread 0 of the task pool?
================
Comment at: lld/ELF/Relocations.cpp:1559
+ };
+ if (serial)
+ fn();
----------------
MaskRay wrote:
> andrewng wrote:
> > I wonder if it might be worthwhile using the previous code for the serial case? Although, it probably doesn't make a big difference to performance.
> Use which piece of code for the serial case?
I was thinking this:
```
for (InputSectionBase *sec : inputSections)
if (sec->isLive() && (sec->flags & SHF_ALLOC))
scanner.template scanSection<ELFT>(*sec);
```
But on the other hand, in terms of future development and maintenance, it's probably better to use as much of the same code for both "paths", even if there's a minor performance penalty for the serial one.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133003/new/
https://reviews.llvm.org/D133003
More information about the llvm-commits
mailing list