[flang][OpenMP] Lowering support for default clause
authorNimish Mishra <neelam.nimish@gmail.com>
Fri, 12 Aug 2022 11:16:26 +0000 (16:46 +0530)
committerNimish Mishra <neelam.nimish@gmail.com>
Fri, 12 Aug 2022 11:16:26 +0000 (16:46 +0530)
commit435feefbdd6c91faf24fa5e69c4e7c3bc127568a
treeb606af7ac7784994b8a9e177c97160811a443241
parent30b779d515e6aa9516f47d8c0ca54b11aaf98cb2
[flang][OpenMP] Lowering support for default clause

This patch adds lowering support for default clause.

1. During symbol resolution in semantics, should the enclosing context
   have a default data sharing clause defined and a `parser::Name` is not
   attached to an explicit data sharing clause, the
   `semantics::Symbol::Flag::OmpPrivate` flag (in case of
   default(private)) and `semantics::Symbol::Flag::OmpFirstprivate` flag
   (in case of default(firstprivate)) is added to the symbol.

2. During lowering, all symbols having either
   `semantics::Symbol::Flag::OmpPrivate` or
   `semantics::Symbol::Flag::OmpFirstprivate` flag are collected and
   privatised appropriately.

Co-authored-by: Peixin Qiao <qiaopeixin@huawei.com>
Reviewed by: peixin

Differential Revision: https://reviews.llvm.org/D123930
flang/include/flang/Lower/AbstractConverter.h
flang/lib/Lower/Bridge.cpp
flang/lib/Lower/OpenMP.cpp
flang/lib/Semantics/resolve-directives.cpp
flang/test/Lower/OpenMP/Todo/omp-default-clause-inner-loop.f90 [new file with mode: 0644]
flang/test/Lower/OpenMP/default-clause.f90 [new file with mode: 0644]
flang/test/Lower/OpenMP/omp-parallel-lastprivate-clause-scalar.f90
flang/test/Semantics/OpenMP/omp-default-clause.f90 [new file with mode: 0644]