[PATCH] D94973: [clang][OpenMP] Use OpenMPIRBuilder for workshare loops.

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 7 09:05:26 PST 2021


jdoerfert added a comment.

I have a single last comment/request. @jdenny I'll take it you finish the review and accept as you see fit.



================
Comment at: llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:986
+  if (BodyGenCB)
+    BodyGenCB(CL->getBodyIP(), CL->getIndVar());
 
----------------
Meinersbur wrote:
> jdoerfert wrote:
> > I'm unsure I understand when it would make sense to not have a body generator.
> As done by EmitOMPCanonicalLoop, the body code can also added to `CL->getBodyIP()` to the CL returned by this function. Calling the callback is the last action done anyway, using the callback just makes the code harder to understand.
I think in the long run the callbacks will provide more usefulness. Since the code generation scope for constructs is then known by the OMPIRBuilder we can track the OpenMP context in the OMPIRBuilder including the `construct` traits. You think it is worse at the call site to pack the body gen in a lambda?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94973



More information about the cfe-commits mailing list