[flang][OpenMP] Support privatization for single construct
authorPeixin Qiao <qiaopeixin@huawei.com>
Wed, 5 Oct 2022 12:22:33 +0000 (20:22 +0800)
committerPeixin Qiao <qiaopeixin@huawei.com>
Wed, 5 Oct 2022 12:22:33 +0000 (20:22 +0800)
commitf4accbf55f4d0fcd6d7cc6f7632a0e4b69c9f3dd
tree4f4d1227f09d7416a628ec5ec21768259fce2d61
parente94619b955104841cc2a4a6febe4025ee140194e
[flang][OpenMP] Support privatization for single construct

This supports the lowering of private and firstprivate clauses in single
construct. The alloca ops are emitted in the entry block according to
https://llvm.org/docs/Frontend/PerformanceTips.html#use-of-allocas, and
the load/store ops are emitted in the single region. The data race
problem is handled in OMPIRBuilder. That is, the barrier is emitted in
OMPIRBuilder.

Co-authored-by: Nimish Mishra <neelam.nimish@gmail.com>
Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D128596
flang/include/flang/Lower/AbstractConverter.h
flang/lib/Lower/Bridge.cpp
flang/lib/Lower/OpenMP.cpp
flang/test/Lower/OpenMP/single.f90