[PATCH] D126323: [OpenMP] Extend omp teams to permit nested omp atomic

Joel E. Denny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 24 13:35:43 PDT 2022


jdenny created this revision.
jdenny added reviewers: jdoerfert, ABataev.
jdenny added a project: OpenMP.
Herald added subscribers: guansong, yaxunl.
Herald added a project: All.
jdenny requested review of this revision.
Herald added subscribers: cfe-commits, sstefan1.
Herald added a project: clang.

OpenMP 5.2, sec. 10.2 "teams Construct", p. 232, L9-12 restricts what
regions can be strictly nested within a `teams` construct.  This patch
relaxes Clang's enforcement of this restriction in the case of nested
`atomic` constructs unless `-fno-openmp-extensions` is specified.
Cases like the following then seem to work fine with no additional
implementation changes:

  #pragma omp target teams map(tofrom:x)
  #pragma omp atomic update
  x++;


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126323

Files:
  clang/lib/Sema/SemaOpenMP.cpp
  clang/test/OpenMP/nesting_of_regions.cpp
  openmp/libomptarget/test/offloading/target-teams-atomic.c
  openmp/runtime/test/teams/teams-atomic.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126323.431775.patch
Type: text/x-patch
Size: 7550 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220524/635210e4/attachment-0001.bin>


More information about the cfe-commits mailing list