Skip to content

Commit 1692791

Browse files
committed
More clean-up
1 parent f6cb909 commit 1692791

File tree

2 files changed

+14
-41
lines changed

2 files changed

+14
-41
lines changed

flang/lib/Lower/OpenMP/DataSharingProcessor.cpp

Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "flang/Optimizer/Builder/Todo.h"
2020
#include "flang/Semantics/tools.h"
2121
#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
22+
#include <variant>
2223

2324
namespace Fortran {
2425
namespace lower {
@@ -397,44 +398,14 @@ void DataSharingProcessor::doPrivatize(
397398

398399
firOpBuilder.setInsertionPointToEnd(allocEntryBlock);
399400

400-
fir::ExtendedValue localExV = symExV.match(
401-
[&](const fir::ArrayBoxValue &box) -> fir::ExtendedValue {
402-
return hlfir::translateToExtendedValue(
403-
symLoc, firOpBuilder,
404-
hlfir::Entity{allocRegion.getArgument(0)}, true)
405-
.first;
406-
},
407-
[&](const fir::CharBoxValue &box) -> fir::ExtendedValue {
408-
TODO(symLoc,
409-
"Delayed privatization is not supported for CharBoxValue");
410-
return {};
411-
},
412-
[&](const fir::CharArrayBoxValue &box) -> fir::ExtendedValue {
413-
TODO(
414-
symLoc,
415-
"Delayed privatization is not supported for CharArrayBoxValue");
416-
return {};
417-
},
418-
[&](const fir::ProcBoxValue &box) -> fir::ExtendedValue {
419-
TODO(symLoc,
420-
"Delayed privatization is not supported for ProcBoxValue");
421-
return {};
422-
},
423-
[&](const fir::BoxValue &box) -> fir::ExtendedValue {
424-
TODO(symLoc, "Delayed privatization is not supported for BoxValue");
425-
return {};
426-
},
427-
[&](const fir::PolymorphicValue &box) -> fir::ExtendedValue {
428-
TODO(symLoc,
429-
"Delayed privatization is not supported for PolymorphicValue");
430-
return {};
431-
},
432-
[&](const auto &box) -> fir::ExtendedValue {
433-
return hlfir::translateToExtendedValue(
434-
symLoc, firOpBuilder,
435-
hlfir::Entity{allocRegion.getArgument(0)}, true)
436-
.first;
437-
});
401+
// TODO Delayed privatization has not been tested yet for: CharBoxValue,
402+
// CharArrayBoxValue, BoxValue, or PolymorphicValue.
403+
fir::ExtendedValue localExV =
404+
hlfir::translateToExtendedValue(
405+
symLoc, firOpBuilder, hlfir::Entity{allocRegion.getArgument(0)},
406+
/*contiguousHint=*/
407+
std::holds_alternative<fir::ArrayBoxValue>(symExV.matchee()))
408+
.first;
438409

439410
symTable->addSymbol(*sym, localExV);
440411
symTable->pushScope();

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,10 +1427,12 @@ genParallelOp(Fortran::lower::AbstractConverter &converter,
14271427
reductionSyms;
14281428
allSymbols.append(privateSyms);
14291429
for (auto [arg, prv] : llvm::zip_equal(allSymbols, region.getArguments())) {
1430-
hlfir::Entity regionArgEntity{prv};
1430+
fir::ExtendedValue hostExV = converter.getSymbolExtendedValue(*arg);
14311431
converter.bindSymbol(*arg, hlfir::translateToExtendedValue(
1432-
loc, firOpBuilder, regionArgEntity,
1433-
regionArgEntity.isArray())
1432+
loc, firOpBuilder, hlfir::Entity{prv},
1433+
/*contiguousHint=*/
1434+
std::holds_alternative<fir::ArrayBoxValue>(
1435+
hostExV.matchee()))
14341436
.first);
14351437
}
14361438

0 commit comments

Comments
 (0)