[Openmp-commits] [PATCH] D105697: [libomptarget][nfc] Drop dead code in parallel_51

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Jul 9 09:48:38 PDT 2021


jdoerfert added a comment.

In D105697#2867396 <https://reviews.llvm.org/D105697#2867396>, @JonChesterfield wrote:

> OK, I can accept that the code is not dead. Attempted to reproduce opt deleting it and failed, looks like that was an artefact of looking at spmd kernels - the library itself does not drop them under optimisation.
>
> Given that it's not dead, and this is a way of passing information to worker threads, surely the parallel level needs to be incremented before whatever the workers are waiting on, which in this case looks like before __kmpc_begin_sharing_variables (or possibly before prepare_parallel), as otherwise the worker threads are fairly likely to run to completion before the parallel level has been incremented?

Workers wait for `__kmpc_barrier_simple_spmd`. Setup has to happen before the first, tear down after the second.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105697



More information about the Openmp-commits mailing list