[flang][OpenMP] Lowering support for default clause
authorNimish Mishra <neelam.nimish@gmail.com>
Fri, 12 Aug 2022 16:35:43 +0000 (22:05 +0530)
committerNimish Mishra <neelam.nimish@gmail.com>
Fri, 12 Aug 2022 16:38:14 +0000 (22:08 +0530)
commit6a305c9b49dd28eaeae694fce5755e279fbc884c
tree7cc029d5d48c04980b705bccc96829ac1d0ffca8
parentd7e0cec60ee3f6f3bfa60764ec1022a4072fe852
[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