[all-commits] [llvm/llvm-project] b291cf: [Flang][OpenMP] Generate correct present checks fo...

agozillon via All-commits all-commits at lists.llvm.org
Fri May 9 04:58:06 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b291cfcad4815568dc1eaca58185d25dceed3f1c
      https://github.com/llvm/llvm-project/commit/b291cfcad4815568dc1eaca58185d25dceed3f1c
  Author: agozillon <Andrew.Gozillon at amd.com>
  Date:   2025-05-09 (Fri, 09 May 2025)

  Changed paths:
    M flang/include/flang/Optimizer/Builder/DirectivesCommon.h
    M flang/lib/Lower/OpenMP/OpenMP.cpp
    M flang/lib/Optimizer/OpenMP/MapInfoFinalization.cpp
    A flang/test/Lower/OpenMP/optional-argument-map-2.f90
    A offload/test/offloading/fortran/optional-mapped-arguments-2.f90

  Log Message:
  -----------
  [Flang][OpenMP] Generate correct present checks for implicit maps of optional allocatables (#138210)

Currently, we do not generate the appropriate checks to check if an
optional
allocatable argument is present before accessing relevant components of
it,
in particular when creating bounds, we must generate a presence check
and we
must make sure we do not generate/keep an load external to the presence
check
by utilising the raw address rather than the regular address of the info
data structure.

Similarly in cases for optional allocatables we must treat them like
non-allocatable
arguments and generate an intermediate allocation that we can have as a
location
in memory that we can access later in the lowering without causing
segfaults when
we perform "mapping" on it, even if the end result is an empty
allocatable
(basically, we shouldn't explode if someone tries to map a non-present
optional,
similar to C++ when mapping null data).



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