Skip to content

Commit 476a514

Browse files
committed
[flang][OpenMP][MLIR] Basic support for delayed privatization code-gen
Adds basic support for emitting delayed privatizers from flang. So far, only types of symbols are supported (i.e. scalars), support for more complicated types will be added later. This also makes sure that reductio and delayed privatization work properly together by merging the body-gen callbacks for both in case both clauses are present on the parallel construct.
1 parent 1a8c613 commit 476a514

File tree

6 files changed

+322
-28
lines changed

6 files changed

+322
-28
lines changed

flang/include/flang/Lower/AbstractConverter.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "flang/Common/Fortran.h"
1717
#include "flang/Lower/LoweringOptions.h"
1818
#include "flang/Lower/PFTDefs.h"
19+
#include "flang/Lower/SymbolMap.h"
1920
#include "flang/Optimizer/Builder/BoxValue.h"
2021
#include "flang/Semantics/symbol.h"
2122
#include "mlir/IR/Builders.h"
@@ -296,6 +297,9 @@ class AbstractConverter {
296297
return loweringOptions;
297298
}
298299

300+
virtual Fortran::lower::SymbolBox
301+
lookupOneLevelUpSymbol(const Fortran::semantics::Symbol &sym) = 0;
302+
299303
private:
300304
/// Options controlling lowering behavior.
301305
const Fortran::lower::LoweringOptions &loweringOptions;

flang/lib/Lower/Bridge.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ class FirConverter : public Fortran::lower::AbstractConverter {
10701070
/// Find the symbol in one level up of symbol map such as for host-association
10711071
/// in OpenMP code or return null.
10721072
Fortran::lower::SymbolBox
1073-
lookupOneLevelUpSymbol(const Fortran::semantics::Symbol &sym) {
1073+
lookupOneLevelUpSymbol(const Fortran::semantics::Symbol &sym) override {
10741074
if (Fortran::lower::SymbolBox v = localSymbols.lookupOneLevelUpSymbol(sym))
10751075
return v;
10761076
return {};

0 commit comments

Comments
 (0)