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

Shilei Tian via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 13 20:06:14 PDT 2020


tianshilei1992 created this revision.
Herald added subscribers: cfe-commits, guansong, yaxunl.
Herald added a reviewer: jdoerfert.
Herald added a project: clang.

Previously for nowait target, CG emitted a function call to
`__tgt_target_nowait`, etc. However, in OpenMP RTL, these functions just
directly call the no-nowait version, which means nowait is not working as
expected.

OpenMP specification says a target is acutally a target task, which is an untied
and detachable task. It is natural to go to the direction that generates a task
for a nowait target. 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.

In D77609 <https://reviews.llvm.org/D77609>, I added the support for unshackled task in OpenMP RTL. Basically,
unshackled task is a task that is not bound to any parallel region. So all
nowait target will be tranformed into an unshackled task. In order to
distinguish from regular task, a new flag bit is set for unshackled task. This
flag will be used by RTL for later process.

Signed-off-by: Shilei Tian <tianshilei1992 at gmail.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78075

Files:
  clang/lib/CodeGen/CGOpenMPRuntime.cpp
  clang/lib/CodeGen/CGOpenMPRuntime.h
  clang/lib/CodeGen/CGStmtOpenMP.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78075.257184.patch
Type: text/x-patch
Size: 6514 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200414/fcfa6699/attachment.bin>


More information about the cfe-commits mailing list