[PATCH] D65835: [OpenMP] Fix map/is_device_ptr with DSA on combined directive

Joel E. Denny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 6 16:43:31 PDT 2019


jdenny created this revision.
jdenny added a reviewer: ABataev.
Herald added a subscriber: guansong.
Herald added a reviewer: jdoerfert.
Herald added a project: clang.

For `map`, the following restriction changed in OpenMP 5.0:

- OpenMP 4.5 [2.15.5.1, Restrictions]: "A list item cannot appear in both a map clause and a data-sharing attribute clause on the same construct.

- OpenMP 5.0 [2.19.7.1, Restrictions]: "A list item cannot appear in both a map clause and a data-sharing attribute clause on the same construct unless the construct is a combined construct."

For `is_device_ptr`, I don't see a restriction in either version, but 
perhaps I missed it.  However, Clang implements a similar restriction
for `is_device_ptr` as for `map`.

This patch removes this restriction in the case of combined
constructs, both for `map` and for `is_device_ptr`.  It does not 
remove the restriction for non-combined constructs even though I'm not 
sure why `is_device_ptr` has the restriction at all.

I haven't yet added any new tests for the `is_device_ptr` case.  I'm 
happy to do so if reviewers feel this patch is heading in the right
direction.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65835

Files:
  clang/lib/Sema/SemaOpenMP.cpp
  clang/test/OpenMP/target_parallel_for_is_device_ptr_messages.cpp
  clang/test/OpenMP/target_parallel_for_simd_is_device_ptr_messages.cpp
  clang/test/OpenMP/target_parallel_is_device_ptr_messages.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_is_device_ptr_messages.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_simd_is_device_ptr_messages.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp
  clang/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp
  clang/test/OpenMP/target_teams_distribute_simd_is_device_ptr_messages.cpp
  clang/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp
  clang/test/OpenMP/target_teams_distribute_simd_private_messages.cpp
  clang/test/OpenMP/target_teams_is_device_ptr_messages.cpp
  clang/test/OpenMP/target_teams_map_codegen.cpp
  clang/test/OpenMP/target_teams_map_messages.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65835.213749.patch
Type: text/x-patch
Size: 34868 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190806/f5de6a2f/attachment-0001.bin>


More information about the cfe-commits mailing list