[PATCH] D90639: Add parallelTransformReduce and parallelForEachError

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 2 12:37:26 PST 2020


rnk created this revision.
rnk added reviewers: rriddle, mehdi_amini.
Herald added a subscriber: dexonsmith.
Herald added a project: LLVM.
rnk requested review of this revision.

parallelTransformReduce is modelled on the C++17 pstl API of
std::transform_reduce, except our wrappers do not use execution policy
parameters.

parallelForEachError allows loops that contain potentially failing
operations to propagate errors out of the loop. This was one of the
major challenges I encountered while parallelizing PDB type merging in
LLD. Parallelizing a loop with parallelForEachError is not behavior
preserving: the loop will no longer stop on the first error, it will
continue working and report all errors it encounters in a list.

I plan to use this to propagate errors out of LLD's
coff::TpiSource::remapTpiWithGHashes, which currently stores errors an
error in the TpiSource object.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90639

Files:
  llvm/include/llvm/Support/Parallel.h
  llvm/unittests/Support/ParallelTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90639.302373.patch
Type: text/x-patch
Size: 5257 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201102/80277948/attachment.bin>


More information about the llvm-commits mailing list