================ @@ -488,44 +559,34 @@ void DataSharingProcessor::doPrivatize(const semantics::Symbol *sym, mlir::OpBuilder::InsertionGuard guard(firOpBuilder); firOpBuilder.setInsertionPointToStart(moduleOp.getBody()); auto result = firOpBuilder.create<mlir::omp::PrivateClauseOp>( - symLoc, uniquePrivatizerName, symType, + symLoc, uniquePrivatizerName, allocType, isFirstPrivate ? mlir::omp::DataSharingClauseType::FirstPrivate : mlir::omp::DataSharingClauseType::Private); fir::ExtendedValue symExV = converter.getSymbolExtendedValue(*sym); lower::SymMapScope outerScope(symTable); - // Populate the `alloc` region. - { - mlir::Region &allocRegion = result.getAllocRegion(); - mlir::Block *allocEntryBlock = firOpBuilder.createBlock( - &allocRegion, /*insertPt=*/{}, symType, symLoc); - - firOpBuilder.setInsertionPointToEnd(allocEntryBlock); - - fir::ExtendedValue localExV = - hlfir::translateToExtendedValue( - symLoc, firOpBuilder, hlfir::Entity{allocRegion.getArgument(0)}, - /*contiguousHint=*/ - evaluate::IsSimplyContiguous(*sym, converter.getFoldingContext())) - .first; - - symTable.addSymbol(*sym, localExV); - lower::SymMapScope innerScope(symTable); - cloneSymbol(sym); - mlir::Value cloneAddr = symTable.shallowLookupSymbol(*sym).getAddr(); - mlir::Type cloneType = cloneAddr.getType(); - - // A `convert` op is required for variables that are storage associated - // via `equivalence`. The problem is that these variables are declared as - // `fir.ptr`s while their privatized storage is declared as `fir.ref`, - // therefore we convert to proper symbol type. - mlir::Value yieldedValue = - (symType == cloneType) ? cloneAddr - : firOpBuilder.createConvert( - cloneAddr.getLoc(), symType, cloneAddr); - - firOpBuilder.create<mlir::omp::YieldOp>(hsb.getAddr().getLoc(), - yieldedValue); + // Populate the `init` region. + const bool needsInitialization = ---------------- ergawy wrote:
Can you comment this variable providing examples for each case where it is set to true? The condition is a bit complex specially the firts part. https://github.com/llvm/llvm-project/pull/124019 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits