[PATCH] D136701: [LinkerWrapper] Perform device linking steps in parallel

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 25 10:32:44 PDT 2022


jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, tianshilei1992, tra, yaxunl, JonChesterfield, ronlieb.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This patch changes the device linking steps to be performed in parallel
when multiple offloading architectures are being used. We use the LLVM
parallelism support to accomplish this by simply doing each inidividual
device linking job in a single thread. This change required re-parsing
the input arguments as these arguments have internal state that would
not be properly shared between the threads otherwise.

By default, the parallelism uses all threads availible. But this can be
controlled with the `--wrapper-jobs=` option. This was required in a few
tests to ensure the ordering was still deterministic.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136701

Files:
  clang/test/Driver/linker-wrapper.c
  clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
  clang/tools/clang-linker-wrapper/LinkerWrapperOpts.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136701.470555.patch
Type: text/x-patch
Size: 7989 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221025/80802e23/attachment-0001.bin>


More information about the cfe-commits mailing list