[all-commits] [llvm/llvm-project] aac1f8: [flang][OpenMP] Explicitly set Shared DSA in symbo...

Leandro Lupori via All-commits all-commits at lists.llvm.org
Tue Jun 3 06:58:45 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aac1f85393e74b643d08c948c3c2da156a231073
      https://github.com/llvm/llvm-project/commit/aac1f85393e74b643d08c948c3c2da156a231073
  Author: Leandro Lupori <leandro.lupori at linaro.org>
  Date:   2025-06-03 (Tue, 03 Jun 2025)

  Changed paths:
    A flang/include/flang/Semantics/openmp-dsa.h
    M flang/include/flang/Semantics/symbol.h
    M flang/lib/Lower/Bridge.cpp
    M flang/lib/Semantics/CMakeLists.txt
    A flang/lib/Semantics/openmp-dsa.cpp
    M flang/lib/Semantics/resolve-directives.cpp
    M flang/test/Semantics/OpenMP/common-block.f90
    M flang/test/Semantics/OpenMP/copyprivate03.f90
    M flang/test/Semantics/OpenMP/default-clause.f90
    M flang/test/Semantics/OpenMP/do05-positivecase.f90
    M flang/test/Semantics/OpenMP/do20.f90
    M flang/test/Semantics/OpenMP/forall.f90
    M flang/test/Semantics/OpenMP/implicit-dsa.f90
    M flang/test/Semantics/OpenMP/reduction08.f90
    M flang/test/Semantics/OpenMP/reduction09.f90
    M flang/test/Semantics/OpenMP/reduction11.f90
    M flang/test/Semantics/OpenMP/scan2.f90
    M flang/test/Semantics/OpenMP/symbol01.f90
    M flang/test/Semantics/OpenMP/symbol02.f90
    M flang/test/Semantics/OpenMP/symbol03.f90
    M flang/test/Semantics/OpenMP/symbol04.f90
    M flang/test/Semantics/OpenMP/symbol05.f90
    M flang/test/Semantics/OpenMP/symbol06.f90
    M flang/test/Semantics/OpenMP/symbol07.f90
    M flang/test/Semantics/OpenMP/symbol08.f90
    M flang/test/Semantics/OpenMP/symbol09.f90

  Log Message:
  -----------
  [flang][OpenMP] Explicitly set Shared DSA in symbols (#142154)

Before this change, OmpShared was not always set in shared symbols.
Instead, absence of private flags was interpreted as shared DSA.
The problem was that symbols with no flags, with only a host
association, could also mean "has same DSA as in the enclosing
context". Now shared symbols behave the same as private and can be
treated the same way.

Because of the host association symbols with no flags mentioned
above, it was also incorrect to simply test the flags of a given
symbol to find out if it was private or shared. The function
GetSymbolDSA() was added to fix this. It would be better to avoid
the need of these special symbols, but this would require changes
to how symbols are collected in lowering.

Besides that, some semantic checks need to know if a DSA clause
was used or not. To avoid confusing implicit symbols with DSA
clauses a new flag was added: OmpExplicit. It is now set for all
symbols with explicitly determined data-sharing attributes.

With the changes above, AddToContextObjectWithDSA() and the symbol
to DSA map could probably be removed and the DSA could be obtained
directly from the symbol, but this was not attempted.

Some debug messages were also added, with the "omp" DEBUG_TYPE, to
make it easier to debug the creation of implicit symbols and to
visualize all associations of a given symbol.

Fixes #130533
Fixes #140882



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list