[Mlir-commits] [flang] [mlir] [mlir][OpenMP][flang] make private variable allocation implicit in omp.private (PR #124019)

Sergio Afonso llvmlistbot at llvm.org
Fri Feb 14 02:36:33 PST 2025


================
@@ -184,7 +218,8 @@ bool DataSharingProcessor::needBarrier() {
   // Emit implicit barrier for linear clause. Maybe on somewhere else.
   for (const semantics::Symbol *sym : allPrivatizedSymbols) {
     if (sym->test(semantics::Symbol::Flag::OmpLastPrivate) &&
-        (sym->test(semantics::Symbol::Flag::OmpFirstPrivate) || callsInitClone))
+        (sym->test(semantics::Symbol::Flag::OmpFirstPrivate) ||
+         mightHaveReadHostSym))
----------------
skatrak wrote:

Ah, thank you for the explanation, that makes sense. I would try to have as few edge cases as possible, so if we can get away with treating every variable the same way, I'd prefer it.

DO loop bounds have to be scalars, so it seems to me that the induction variable couldn't trigger this via the `mightHaveReadHostSym=true` path. Also, semantics triggers an error about passing a loop induction variable into a `firstprivate` clause, so it seems like we should be fine without adding an edge case for this.

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


More information about the Mlir-commits mailing list