[all-commits] [llvm/llvm-project] b2c9a5: [Flang][OpenMP][MLIR] Check for presence of Box ty...

agozillon via All-commits all-commits at lists.llvm.org
Mon Apr 14 08:16:17 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b2c9a58b8f28b353b3f0b4ef98fa704c463ba1a4
      https://github.com/llvm/llvm-project/commit/b2c9a58b8f28b353b3f0b4ef98fa704c463ba1a4
  Author: agozillon <Andrew.Gozillon at amd.com>
  Date:   2025-04-14 (Mon, 14 Apr 2025)

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

  Log Message:
  -----------
  [Flang][OpenMP][MLIR] Check for presence of Box type before emitting store in MapInfoFinalization pass (#135477)

Currently we don't check for the presence of descriptor/BoxTypes before
emitting stores which lower to memcpys, the issue with this is that
users can have optional arguments, where they don't provide an input,
making the argument effectively null. This can still be mapped and this
causes issues at the moment as we'll emit a memcpy for function
arguments to store to a local variable for certain edge cases, when we
perform this memcpy on a null input, we cause a segfault at runtime.

The fix to this is to simply create a branch around the store that
checks if the data we're copying from is actually present. If it is, we
proceed with the store, if it isn't we skip it.



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