[all-commits] [llvm/llvm-project] 0e7ddf: [flang][OpenMP] Improve locality check when determ...

Krzysztof Parzyszek via All-commits all-commits at lists.llvm.org
Mon Feb 9 13:54:23 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0e7ddf395a12e0201ed0ca7131439c2fd355a72a
      https://github.com/llvm/llvm-project/commit/0e7ddf395a12e0201ed0ca7131439c2fd355a72a
  Author: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
  Date:   2026-02-09 (Mon, 09 Feb 2026)

  Changed paths:
    M flang/lib/Semantics/resolve-directives.cpp
    A flang/test/Semantics/OpenMP/local-variables-1.f90
    A flang/test/Semantics/OpenMP/local-variables-2.f90
    R flang/test/Semantics/OpenMP/local-variables.f90

  Log Message:
  -----------
  [flang][OpenMP] Improve locality check when determining DSA (#180583)

Follow-up to https://github.com/llvm/llvm-project/pull/178739.

The locality check assumed that immediately after the initial symbol
resolution (i.e. prior to the OpenMP code in resolve-directives.cpp),
the scope that owns a given symbol is the scope which owns the symbol's
storage. Turns out that this isn't necessarily true as illustrated by
the included testcase, roughly something like:
```
program main
  integer :: j        ! host j (storage-owning)
  contains
  subroutine f
    !$omp parallel    ! scope that owns j, but j is host-associated
    do j = ...
    end do
    !$omp end parallel
  end
end program
```

In such cases, the locality should be checked for the symbol that owns
storage, i.e. a clone of the symbol that is has been privatized or a
symbol that is not host- or use-associated. This is similar to obtaning
the ultimate symbol (i.e. from the end of association chain), except the
chain traversal would stop at a privatized symbol, potentially before
reaching the end.

This fixes a few regressions in the Fujitsu test suite:
Fujitsu/Fortran/0160/Fujitsu-Fortran-0160_0000.test
Fujitsu/Fortran/0160/Fujitsu-Fortran-0160_0012.test
Fujitsu/Fortran/0160/Fujitsu-Fortran-0160_0013.test
Fujitsu/Fortran/0660/Fujitsu-Fortran-0660_0096.test
Fujitsu/Fortran/0660/Fujitsu-Fortran-0660_0097.test
Fujitsu/Fortran/1052/Fujitsu-Fortran-1052_0108.test
Fujitsu/Fortran/1052/Fujitsu-Fortran-1052_0112.test



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