[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 22 04:18:59 PDT 2021


peixin created this revision.
peixin added reviewers: kiranchandramohan, clementval, sscalpone, jdoerfert, richard.barton.arm, sameeranjoshi, praveen, SouraVX, arnamoy10, bryanpkc.
peixin added a project: LLVM.
Herald added subscribers: guansong, yaxunl.
peixin requested review of this revision.
Herald added subscribers: llvm-commits, sstefan1.

This patch implements the following check for cancellation constructs:

  OpenMP Version 5.0 Section 2.18.1: CANCEL construct restriction:
  If construct-type-clause is taskgroup, the cancel construct must be
  closely nested inside a task or a taskloop construct and the cancel
  region must be closely nested inside a taskgroup region. If
  construct-type-clause is sections, the cancel construct must be closely
  nested inside a sections or section construct. Otherwise, the cancel
  construct must be closely nested inside an OpenMP construct that matches
  the type specified in construct-type-clause of the cancel construct.
  
  OpenMP Version 5.0 Section 2.18.2: CANCELLATION POINT restriction:
  A cancellation point construct for which construct-type-clause is
  taskgroup must be closely nested inside a task or taskloop construct,
  and the cancellation point region must be closely nested inside a
  taskgroup region. A cancellation point construct for which
  construct-type-clause is sections must be closely nested inside a
  sections or section construct. A cancellation point construct for which
  construct-type-clause is neither sections nor taskgroup must be closely
  nested inside an OpenMP construct that matches the type specified in
  construct-type-clause.

Also add test cases for the check.


Repository:
  rG LLVM Github Monorepo

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.360764.patch
Type: text/x-patch
Size: 12013 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210722/5773f280/attachment.bin>


More information about the llvm-commits mailing list