[all-commits] [llvm/llvm-project] 9155b3: [Flang][OpenMP] Defer descriptor mapping for assum...

agozillon via All-commits all-commits at lists.llvm.org
Thu Oct 9 08:53:04 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9155b318f2cbdac1201633c31abada6380d53d7a
      https://github.com/llvm/llvm-project/commit/9155b318f2cbdac1201633c31abada6380d53d7a
  Author: agozillon <Andrew.Gozillon at amd.com>
  Date:   2025-10-09 (Thu, 09 Oct 2025)

  Changed paths:
    M flang/lib/Optimizer/OpenMP/MapInfoFinalization.cpp
    A flang/test/Lower/OpenMP/map-descriptor-deferral.f90
    M flang/test/Transforms/omp-map-info-finalization.fir
    A offload/test/offloading/fortran/descriptor-stack-jam-regression.f90

  Log Message:
  -----------
  [Flang][OpenMP] Defer descriptor mapping for assumed dummy argument types (#154349)

This PR adds deferral of descriptor maps until they are necessary for
assumed dummy argument types. The intent is to avoid a problem where a
user can inadvertently map a temporary local descriptor to device
without their knowledge and proceed to never unmap it. This temporary
local descriptor remains lodged in OpenMP device memory and the next
time another variable or descriptor residing in the same stack address
is mapped we incur a runtime OpenMP map error as we try to remap the
same address.

This fix was discussed with the OpenMP committee and applies to OpenMP
5.2 and below, future versions of OpenMP can avoid this issue via the
attach semantics added to the specification.



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