[PATCH] D79390: [Support] Sink LLD's parallel algorithm wrappers to support

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 20:27:53 PDT 2020


rnk created this revision.
rnk added reviewers: MaskRay, aganea.
Herald added subscribers: mgrang, aheejin, arichardson, sbc100, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

Essentially takes the lld/Common/Threads.h wrappers and moves them to
the llvm/Support/Paralle.h algorithm header.

The changes are:

- Add range overloads
- Use the sequential algorithm directly when 1 thread is requested (skips task grouping)
- Fix the index type of for_each_n to size_t. Nobody in LLVM was using any other parameter, and it made overload resolution hard for for_each_n(par, 0, foo.size(), ...) because 0 is int, not size_t.

Remove Threads.h and update LLD for that.

This is a prerequisite for parallel public symbol processing in the PDB
library, which is in LLVM.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79390

Files:
  lld/COFF/Driver.cpp
  lld/COFF/ICF.cpp
  lld/COFF/LLDMapFile.cpp
  lld/COFF/MapFile.cpp
  lld/COFF/PDB.cpp
  lld/COFF/Writer.cpp
  lld/Common/ErrorHandler.cpp
  lld/Common/Filesystem.cpp
  lld/ELF/Driver.cpp
  lld/ELF/ICF.cpp
  lld/ELF/LinkerScript.cpp
  lld/ELF/MapFile.cpp
  lld/ELF/OutputSections.cpp
  lld/ELF/SyntheticSections.cpp
  lld/ELF/Writer.cpp
  lld/include/lld/Common/Threads.h
  lld/wasm/Driver.cpp
  lld/wasm/OutputSections.cpp
  lld/wasm/Writer.cpp
  llvm/include/llvm/Support/Parallel.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79390.261996.patch
Type: text/x-patch
Size: 27301 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200505/351464ae/attachment.bin>


More information about the llvm-commits mailing list