[PATCH] D117510: [Support] Merge parallel_for_each into parallelForEach

Chris Lattner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 17 22:37:19 PST 2022


lattner added a comment.

Cool, thank you for working to improve this.   As mentioned on https://reviews.llvm.org/D101699, dropping the special case for 1 element will have catastrophic performance impacts for some workloads (e.g. in the MLIR/CIRCT world) because of the problems that Threading.h has with nested parallelism.

Have you tried detemplating this entirely?  If something is interesting to parallelize, then the granule of work should not be tiny.  I'd consider moving this to take a `unique_function<void()>`, which would allow moving the implementation details of all of this out of line to a .cpp file.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117510/new/

https://reviews.llvm.org/D117510



More information about the llvm-commits mailing list