[PATCH] D78075: [WIP][Clang][OpenMP] Added support for nowait target in CodeGen

Shilei Tian via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 14 16:02:51 PDT 2020


tianshilei1992 added a comment.

In D78075#2272398 <https://reviews.llvm.org/D78075#2272398>, @ye-luo wrote:

>> However, OpenMP task has a problem that it must be within
>> to a parallel region; otherwise the task will be executed immediately. As a
>> result, if we directly wrap to a regular task, the nowait target outside of a
>> parallel region is still a synchronous version.
>
> The spec says an implicit task can be generated by an implicit parallel region which can be the whole OpenMP program. For this reason, the need of explicit parallel region is a limitation of the llvm OpenMP runtime, right?
>
> Can I have an option to run the nowait region as a regular task instead of an unshackled task? So I can use "parallel" and well established ways to control the thread affinity.

According to the spec, an implicit parallel region is an inactive parallel region that is not generated from a parallel construct. And based on the definition of active parallel region, which is a parallel region that is executed by a team consisting of more than one thread, an inactive parallel region only has one thread. Since we only have one thread, if we encounter a task, executing it immediately does make sense as we don't have another thread to execute it.

I do remember your request about the regular task. This patch is exactly what you need. Later when I finish the RTL, I could provide an option.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78075



More information about the cfe-commits mailing list