[PATCH] D99970: [flang][OpenMP] Add functionality to check "close nesting" of regions, which can be used for Semantic checks.

Arnamoy B via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 6 09:43:42 PDT 2021


arnamoy10 created this revision.
arnamoy10 added reviewers: kiranchandramohan, bryanpkc, kiranktp, clementval, SouraVX, AMDChirag.
arnamoy10 added projects: Flang, OpenMP.
Herald added subscribers: jdoerfert, jfb, guansong, yaxunl.
arnamoy10 requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: llvm-commits, sstefan1.
Herald added a project: LLVM.

This patch adds a function to help Semantic checks that deal with "closely nesting" condition check.

Also modifies the closely nesting semantic check code for worksharing regions.  Previously the check was checking only the immediate parent.  e.g

  !$omp do
   !omp target
    !$omp do

In the previous code, though the inside `do` is closely nested inside the outside `do` (no `parallel` in between), the existing check would not catch the violation, as the immediate parent of the nested `do` is `target`.

With the new function, this condition will be caught.

More test cases are added to check more scenarios.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99970

Files:
  flang/lib/Semantics/check-omp-structure.cpp
  flang/lib/Semantics/check-omp-structure.h
  flang/test/Semantics/omp-do05.f90
  flang/test/Semantics/omp-nested01.f90
  flang/test/Semantics/omp-reduction07.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99970.335555.patch
Type: text/x-patch
Size: 7835 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210406/c1445adf/attachment.bin>


More information about the llvm-commits mailing list