[all-commits] [llvm/llvm-project] 70894c: [flang][OpenMP] Add semantic checks for cancellati...

PeixinQiao via All-commits all-commits at lists.llvm.org
Fri Aug 13 07:11:34 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 70894c8dd14d35ba8bc6ab317d76e0b325c3f7f0
      https://github.com/llvm/llvm-project/commit/70894c8dd14d35ba8bc6ab317d76e0b325c3f7f0
  Author: Peixin Qiao <qiaopeixin at huawei.com>
  Date:   2021-08-13 (Fri, 13 Aug 2021)

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

  Log Message:
  -----------
  [flang][OpenMP] Add semantic checks for cancellation nesting

This patch implements the following semantic checks 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.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D106538




More information about the All-commits mailing list