|
12 | 12 |
|
13 | 13 | #include "flang/Lower/Bridge.h" |
14 | 14 |
|
15 | | -#include "OpenMP/DataSharingProcessor.h" |
16 | 15 | #include "flang/Lower/Allocatable.h" |
17 | 16 | #include "flang/Lower/CallInterface.h" |
18 | 17 | #include "flang/Lower/Coarray.h" |
@@ -2040,44 +2039,38 @@ class FirConverter : public Fortran::lower::AbstractConverter { |
2040 | 2039 | bool useDelayedPriv = |
2041 | 2040 | enableDelayedPrivatizationStaging && doConcurrentLoopOp; |
2042 | 2041 | llvm::SetVector<const Fortran::semantics::Symbol *> allPrivatizedSymbols; |
| 2042 | + llvm::SmallSet<const Fortran::semantics::Symbol *, 16> mightHaveReadHostSym; |
2043 | 2043 |
|
2044 | | - for (const Fortran::semantics::Symbol *sym : info.localSymList) { |
| 2044 | + for (const Fortran::semantics::Symbol *symToPrivatize : info.localSymList) { |
2045 | 2045 | if (useDelayedPriv) { |
2046 | 2046 | Fortran::lower::privatizeSymbol<fir::LocalitySpecifierOp>( |
2047 | | - *this, this->getFirOpBuilder(), localSymbols, |
2048 | | - [this](fir::LocalitySpecifierOp result, mlir::Type argType) { |
2049 | | - TODO(this->toLocation(), |
2050 | | - "Localizers that need init regions are not supported yet."); |
2051 | | - }, |
2052 | | - allPrivatizedSymbols, sym, &privateClauseOps); |
| 2047 | + *this, this->getFirOpBuilder(), localSymbols, allPrivatizedSymbols, |
| 2048 | + mightHaveReadHostSym, symToPrivatize, &privateClauseOps); |
2053 | 2049 | continue; |
2054 | 2050 | } |
2055 | 2051 |
|
2056 | | - createHostAssociateVarClone(*sym, /*skipDefaultInit=*/false); |
| 2052 | + createHostAssociateVarClone(*symToPrivatize, /*skipDefaultInit=*/false); |
2057 | 2053 | } |
2058 | 2054 |
|
2059 | | - for (const Fortran::semantics::Symbol *sym : info.localInitSymList) { |
| 2055 | + for (const Fortran::semantics::Symbol *symToPrivatize : |
| 2056 | + info.localInitSymList) { |
2060 | 2057 | if (useDelayedPriv) { |
2061 | 2058 | Fortran::lower::privatizeSymbol<fir::LocalitySpecifierOp>( |
2062 | | - *this, this->getFirOpBuilder(), localSymbols, |
2063 | | - [this](fir::LocalitySpecifierOp result, mlir::Type argType) { |
2064 | | - TODO(this->toLocation(), |
2065 | | - "Localizers that need init regions are not supported yet."); |
2066 | | - }, |
2067 | | - allPrivatizedSymbols, sym, &privateClauseOps); |
| 2059 | + *this, this->getFirOpBuilder(), localSymbols, allPrivatizedSymbols, |
| 2060 | + mightHaveReadHostSym, symToPrivatize, &privateClauseOps); |
2068 | 2061 | continue; |
2069 | 2062 | } |
2070 | 2063 |
|
2071 | | - createHostAssociateVarClone(*sym, /*skipDefaultInit=*/true); |
| 2064 | + createHostAssociateVarClone(*symToPrivatize, /*skipDefaultInit=*/true); |
2072 | 2065 | const auto *hostDetails = |
2073 | | - sym->detailsIf<Fortran::semantics::HostAssocDetails>(); |
| 2066 | + symToPrivatize->detailsIf<Fortran::semantics::HostAssocDetails>(); |
2074 | 2067 | assert(hostDetails && "missing locality spec host symbol"); |
2075 | 2068 | const Fortran::semantics::Symbol *hostSym = &hostDetails->symbol(); |
2076 | 2069 | Fortran::evaluate::ExpressionAnalyzer ea{semanticsContext}; |
2077 | 2070 | Fortran::evaluate::Assignment assign{ |
2078 | | - ea.Designate(Fortran::evaluate::DataRef{*sym}).value(), |
| 2071 | + ea.Designate(Fortran::evaluate::DataRef{*symToPrivatize}).value(), |
2079 | 2072 | ea.Designate(Fortran::evaluate::DataRef{*hostSym}).value()}; |
2080 | | - if (Fortran::semantics::IsPointer(*sym)) |
| 2073 | + if (Fortran::semantics::IsPointer(*symToPrivatize)) |
2081 | 2074 | assign.u = Fortran::evaluate::Assignment::BoundsSpec{}; |
2082 | 2075 | genAssignment(assign); |
2083 | 2076 | } |
|
0 commit comments