[flang-commits] [flang] [flang][OpenMP] Try to unify induction var privatization for sequential loops inside parallel regions. (PR #91116)

Leandro Lupori via flang-commits flang-commits at lists.llvm.org
Wed May 8 05:35:54 PDT 2024


================
@@ -92,19 +92,6 @@ void DataSharingProcessor::insertDeallocs() {
 }
 
 void DataSharingProcessor::cloneSymbol(const Fortran::semantics::Symbol *sym) {
-  // Privatization for symbols which are pre-determined (like loop index
-  // variables) happen separately, for everything else privatize here.
-  auto isOMPParallelConstruct = [](Fortran::lower::pft::Evaluation &eval) {
-    if (const auto *ompConstruct = eval.getIf<parser::OpenMPConstruct>())
-      if (std::holds_alternative<parser::OpenMPBlockConstruct>(ompConstruct->u))
-        return true;
-    return false;
-  };
-
-  if (sym->test(Fortran::semantics::Symbol::Flag::OmpPreDetermined) &&
-      !isOMPParallelConstruct(eval))
-    return;
----------------
luporl wrote:

By removing this check and leaving `genLoopVars` and `createAndSetPrivatizedLoopVar` unmodified, pre-determined loop induction variables will be privatized twice. It will probably work correctly, but at some point this needs to be addressed.

https://github.com/llvm/llvm-project/pull/91116


More information about the flang-commits mailing list