[all-commits] [llvm/llvm-project] 932f02: [Support] Move LLD's parallel algorithm wrappers t...

Reid Kleckner via All-commits all-commits at lists.llvm.org
Tue May 5 15:21:23 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 932f0276ea29fd58e1a07947e302f3ca9b54e61a
      https://github.com/llvm/llvm-project/commit/932f0276ea29fd58e1a07947e302f3ca9b54e61a
  Author: Reid Kleckner <rnk at google.com>
  Date:   2020-05-05 (Tue, 05 May 2020)

  Changed paths:
    M lld/COFF/Driver.cpp
    M lld/COFF/ICF.cpp
    M lld/COFF/LLDMapFile.cpp
    M lld/COFF/MapFile.cpp
    M lld/COFF/PDB.cpp
    M lld/COFF/Writer.cpp
    M lld/Common/ErrorHandler.cpp
    M lld/Common/Filesystem.cpp
    M lld/ELF/Driver.cpp
    M lld/ELF/ICF.cpp
    M lld/ELF/LinkerScript.cpp
    M lld/ELF/MapFile.cpp
    M lld/ELF/OutputSections.cpp
    M lld/ELF/SyntheticSections.cpp
    M lld/ELF/Writer.cpp
    R lld/include/lld/Common/Threads.h
    M lld/lib/ReaderWriter/MachO/LayoutPass.cpp
    M lld/wasm/Driver.cpp
    M lld/wasm/OutputSections.cpp
    M lld/wasm/Writer.cpp
    M llvm/include/llvm/Support/Parallel.h
    M llvm/unittests/Support/ParallelTest.cpp
    M mlir/docs/Diagnostics.md
    M mlir/lib/Pass/Pass.cpp
    M mlir/lib/Transforms/Inliner.cpp

  Log Message:
  -----------
  [Support] Move LLD's parallel algorithm wrappers to support

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

The changes are:
- Remove policy parameter, since all clients use `par`.
- Rename the methods to `parallelSort` etc to match LLVM style, since
  they are no longer C++17 pstl compatible.
- Move algorithms from llvm::parallel:: to llvm::, since they have
  "parallel" in the name and are no longer overloads of the regular
  algorithms.
- Add range overloads
- Use the sequential algorithm directly when 1 thread is requested
  (skips task grouping)
- Fix the index type of parallelForEachN 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.

Reviewed By: MaskRay, aganea

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




More information about the All-commits mailing list