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

Leandro Lupori llvmlistbot at llvm.org
Thu Feb 13 09:10:37 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))
----------------
luporl wrote:

Thanks for the quick fix.
I only wanted to point out that, in this case, `x` wouldn't even need to be read at all.
Actually, this optimization is implemented in #125901.

Do you think there is any advantage in treating induction variables differently?

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


More information about the Mlir-commits mailing list