[Openmp-commits] [PATCH] D152054: [OpenMP] Codegen support for thread_limit on target directive
Sandeep via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Fri Aug 4 00:02:43 PDT 2023
sandeepkosuri added inline comments.
================
Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:9866
+ (CGM.getLangOpts().OpenMP >= 51 &&
+ needsTaskBasedThreadLimit(D.getDirectiveKind()) &&
+ D.hasClausesOfKind<OMPThreadLimitClause>());
----------------
ABataev wrote:
> I think you don't need needsTaskBasedThreadLimit call here, the emitTargetCall function itself can be called only for target-based directives
`emitTargetCall()` is called for all the target based directives, even target - team based directives, which already have a thread limit implementation in place. So, I need `needsTaskBasedThreadLimit` to select applicable directives only.
================
Comment at: clang/lib/CodeGen/CGStmtOpenMP.cpp:5143
+ if (CGF.CGM.getLangOpts().OpenMP >= 51 &&
+ needsTaskBasedThreadLimit(S.getDirectiveKind()) && TL) {
+ // Emit __kmpc_set_thread_limit() to set the thread_limit for the task
----------------
ABataev wrote:
> Same regarding needsTaskBasedThreadLimit(S.getDirectiveKind()) , the function EmitOMPTargetTaskBasedDirective is called only for target-based directives
Similarly here as well.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152054/new/
https://reviews.llvm.org/D152054
More information about the Openmp-commits
mailing list