HomePhabricator

Add parallelTransformReduce and parallelForEachError

Authored by rnk on Nov 2 2020, 10:15 AM.

Description

Add parallelTransformReduce and parallelForEachError

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.

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

Details

Committed
rnkNov 2 2020, 4:50 PM
Differential Revision
D90639: Add parallelTransformReduce and parallelForEachError
Parents
rGca01a6b3aceb: [PowerPC] Parse and ignore .machine ppc64
Branches
Unknown
Tags
Unknown