[flang-commits] [flang] [flang][OpenMP] don't privatise loop index marked shared (PR #108176)

Leandro Lupori via flang-commits flang-commits at lists.llvm.org
Wed Sep 11 13:05:14 PDT 2024


================
@@ -2173,7 +2178,7 @@ void OmpAttributeVisitor::CreateImplicitSymbols(
       // TODO 5) dummy arg in orphaned taskgen construct -> firstprivate
       if (prevDSA == Symbol::Flag::OmpShared) {
         // 6) shared in enclosing context -> shared
-        makeSharedSymbol();
+        makeSharedSymbol(/*setFlag=*/false);
----------------
luporl wrote:

Setting `Symbol::Flag::OmpShared` on shared symbols seems a good idea to me. With it, we don't have to interpret `no privatisation flags` as shared anymore and it is also clearer in tests and when using the `-fdebug-unparse-with-symbols`.

But if we take this path, I think it's better to set it for all cases, to avoid having some shared symbols with `OmpShared` and others without it, which would be confusing. This may require some extra work though.

Can't it also be set in cases `2) parallel -> shared` and `6) shared in enclosing context -> shared`?

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


More information about the flang-commits mailing list