[PATCH] D92476: [OpenMPIRBuilder] introduce createStaticWorkshareLoop
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 7 08:06:33 PST 2020
jdoerfert added inline comments.
================
Comment at: llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:1106-1108
+ FunctionCallee BarrierFunc =
+ getOrCreateRuntimeFunction(M, omp::OMPRTL___kmpc_barrier);
+ Builder.CreateCall(BarrierFunc, {SrcLoc, ThreadNum});
----------------
ftynse wrote:
> kiranchandramohan wrote:
> > Nit: There is a create barrier function in the OpenMPIRBuilder.
> > CreateBarrier(Builder.saveIP(), llvm::omp::OMPD_barrier);
> Yes, but it would emit another call to get_thread_num and `OMPD_barrier` could misled somebody to think the emitted code comes from a barrier directive, which it is not.
> but it would emit another call to get_thread_num
That is not a problem we address here. They are deduplicated later.
> OMPD_barrier could misled somebody to think the emitted code comes from a barrier directive, which it is not.
The OpenMP runtime is integrated with existing tooling. Barriers "know" what caused them and that is available to profilers, debuggers, etc. We should not break with this tooling capability. The worksharing type for barriers is available via:
`createBarrier(Loc, OMPD_for, /* ForceSimpleCall */ false, /* CheckCancelFlag */ false)`
The last argument is false only for now. The cancel flag capabilities will be needed later as well, at least from the OpenMP frontends.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92476/new/
https://reviews.llvm.org/D92476
More information about the llvm-commits
mailing list