[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:13 PDT 2024


================
@@ -1326,7 +1326,8 @@ class FirConverter : public Fortran::lower::AbstractConverter {
                                      bool isUnordered) {
     if (isUnordered || sym.has<Fortran::semantics::HostAssocDetails>() ||
         sym.has<Fortran::semantics::UseDetails>()) {
-      if (!shallowLookupSymbol(sym)) {
+      if (!shallowLookupSymbol(sym) &&
+          !sym.test(Fortran::semantics::Symbol::Flag::OmpShared)) {
----------------
luporl wrote:

An alternative here would be to check if no privatisation flag is present, to conclude the variable is shared.

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


More information about the flang-commits mailing list