Skip to content

Commit e6a7bd8

Browse files
committed
Handle review comments.
1 parent 6c67544 commit e6a7bd8

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

flang/include/flang/Optimizer/Builder/BoxValue.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -535,17 +535,6 @@ class ExtendedValue : public details::matcher<ExtendedValue> {
535535

536536
const VT &matchee() const { return box; }
537537

538-
/// Clone an ExtendedValue to a new instance changing the base address.
539-
///
540-
/// TODO So far, this is only a shallow clone; only the base address is
541-
/// replaced. This will probably be extended to implement deep cloning to
542-
/// support scenarios such as delayed privatization for ArrayBoxValue's.
543-
ExtendedValue clone(mlir::Value newBase) const {
544-
return match(
545-
[&](const UnboxedValue &box) -> ExtendedValue { return newBase; },
546-
[&](const auto &box) -> ExtendedValue { return box.clone(newBase); });
547-
}
548-
549538
private:
550539
VT box;
551540
};

flang/lib/Lower/OpenMP/DataSharingProcessor.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void DataSharingProcessor::processStep2(mlir::Operation *op, bool isLoop) {
5050
}
5151

5252
void DataSharingProcessor::insertDeallocs() {
53-
// TODO Extend delayed privatization to include a `dealloc` region?
53+
// TODO Extend delayed privatization to include a `dealloc` region.
5454
for (const Fortran::semantics::Symbol *sym : privatizedSymbols)
5555
if (Fortran::semantics::IsAllocatable(sym->GetUltimate())) {
5656
converter.createHostAssociateVarCloneDealloc(*sym);
@@ -388,7 +388,8 @@ void DataSharingProcessor::doPrivatize(const Fortran::semantics::Symbol *sym) {
388388
&allocRegion, /*insertPt=*/{}, symType, symLoc);
389389

390390
firOpBuilder.setInsertionPointToEnd(allocEntryBlock);
391-
symTable->addSymbol(*sym, symExV.clone(allocRegion.getArgument(0)));
391+
symTable->addSymbol(*sym,
392+
fir::substBase(symExV, allocRegion.getArgument(0)));
392393
symTable->pushScope();
393394
cloneSymbol(sym);
394395
firOpBuilder.create<mlir::omp::YieldOp>(
@@ -405,10 +406,10 @@ void DataSharingProcessor::doPrivatize(const Fortran::semantics::Symbol *sym) {
405406
mlir::Block *copyEntryBlock = firOpBuilder.createBlock(
406407
&copyRegion, /*insertPt=*/{}, {symType, symType}, {symLoc, symLoc});
407408
firOpBuilder.setInsertionPointToEnd(copyEntryBlock);
408-
symTable->addSymbol(*sym, symExV.clone(copyRegion.getArgument(0)),
409+
symTable->addSymbol(*sym, fir::substBase(symExV, copyRegion.getArgument(0)),
409410
/*force=*/true);
410411
symTable->pushScope();
411-
symTable->addSymbol(*sym, symExV.clone(copyRegion.getArgument(1)));
412+
symTable->addSymbol(*sym, fir::substBase(symExV, copyRegion.getArgument(1)));
412413
auto ip = firOpBuilder.saveInsertionPoint();
413414
copyFirstPrivateSymbol(sym, &ip);
414415

0 commit comments

Comments
 (0)