[flang-commits] [flang] [flang][OpenMP] Initialize allocatable members of derived types (PR #120295)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Fri Jan 10 11:06:23 PST 2025


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

Do I understand correctly that the barrier here isn't strictly necessary because v and v2 are different symbols?
 https://github.com/llvm/llvm-project/pull/120295/files#diff-7f918db826ee2c02ce8eb509f6d8367ad741d2b1537396959d510b5fe6a29a37R52

I'm trying to add the extra barriers in my re-implementation of this patch in my changes for https://discourse.llvm.org/t/rfc-openmp-supporting-delayed-task-execution-with-firstprivate-variables/83084/7

Thanks for the help!

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


More information about the flang-commits mailing list