[PATCH] D106538: [flang][OpenMP] Add semantic check for cancellation nesting

Peixin Qiao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 29 04:48:37 PDT 2021


peixin updated this revision to Diff 362719.
peixin set the repository for this revision to rG LLVM Github Monorepo.
peixin added a comment.

Add the following test scenarios, which is `taskgroup` nested between `parallel` and `cancel taskgroup` and fix the implementation by break the for loop when encountering `taskgroup` or `parallel/target parallel`.

  !$omp parallel
  !$omp taskgroup
  !$omp task
  !$omp cancel taskgroup
  a = 3.14
  !$omp end task
  !$omp end taskgroup
  !$omp end parallel

  !$omp parallel
  !$omp taskgroup
  !$omp taskloop nogroup
  do i = 1, N
    !$omp cancel taskgroup
    a = 3.14
  end do
  !$omp end taskloop
  !$omp end taskgroup
  !$omp end parallel

By the way, according to the description of `target parallel` construct in OpenMP 5.0 Specification, the `target parallel` construct should have the similar behavior as the above `parallel` construct.

  Target Parallel Description
  The semantics are identical to explicitly specifying a target directive immediately followed by a parallel directive.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106538

Files:
  flang/lib/Semantics/check-omp-structure.cpp
  flang/lib/Semantics/check-omp-structure.h
  flang/test/Semantics/omp-clause-validity01.f90
  flang/test/Semantics/omp-nested-cancel.f90
  flang/test/Semantics/omp-nested-cancellation-point.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106538.362719.patch
Type: text/x-patch
Size: 20306 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210729/1ef6fa50/attachment.bin>


More information about the llvm-commits mailing list