[flang-commits] [flang] [Flang][OpenMP]Support for lowering task_reduction and in_reduction to MLIR (PR #111155)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Thu Jan 9 09:00:31 PST 2025


================
@@ -344,8 +344,15 @@ void DataSharingProcessor::collectSymbols(
   // Collect all symbols referenced in the evaluation being processed,
   // that matches 'flag'.
   llvm::SetVector<const semantics::Symbol *> allSymbols;
+
+  auto itr = llvm::find_if(clauses, [](const omp::Clause &clause) {
+    return clause.id == llvm::omp::Clause::OMPC_in_reduction;
+  });
+
+  bool collectSymbols = (itr == clauses.end());
+
   converter.collectSymbolSet(eval, allSymbols, flag,
-                             /*collectSymbols=*/true,
+                             /*collectSymbols=*/collectSymbols,
----------------
skatrak wrote:

Nit: The comment is redundant when passing a variable instead of a constant.
```suggestion
                             collectSymbols,
```

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


More information about the flang-commits mailing list