[PATCH] D90101: [Clang][OpenMP][WIP] Avoid unnecessary privatization of mapper array when there is no user defined mapper

Shilei Tian via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 24 10:25:08 PDT 2020


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

In current implementation, if it requires an outer task, the mapper array will be privatized no matter whether it has mapper. In fact, when there is no mapper, the mapper array only contains number of nullptr. In the libomptarget, the use of mapper array is `if (mappers_array && mappers_array[i])`, which means we can directly set mapper array to nullptr if there is no mapper. This can avoid unnecessary data copy.

In this patch, the data privatization will not be emitted if the mapper array is nullptr. When it comes to the emit of task body, the nullptr will be used directly.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90101

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90101.300493.patch
Type: text/x-patch
Size: 5387 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201024/ad6d321b/attachment.bin>


More information about the cfe-commits mailing list