[all-commits] [llvm/llvm-project] e0054e: [MLIR][OpenMP] Emit nullary check for mapped point...

agozillon via All-commits all-commits at lists.llvm.org
Wed Jan 29 08:51:55 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e0054e984cac39322afa32a6e68fc794f0081f49
      https://github.com/llvm/llvm-project/commit/e0054e984cac39322afa32a6e68fc794f0081f49
  Author: agozillon <Andrew.Gozillon at amd.com>
  Date:   2025-01-29 (Wed, 29 Jan 2025)

  Changed paths:
    M flang/test/Integration/OpenMP/map-types-and-sizes.f90
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
    M mlir/test/Target/LLVMIR/omptarget-nested-ptr-record-type-mapping-host.mlir
    A mlir/test/Target/LLVMIR/omptarget-nullary-record-ptr-member-map.mlir
    M mlir/test/Target/LLVMIR/omptarget-record-type-with-ptr-member-host.mlir
    A offload/test/offloading/fortran/target-map-nullary-pointer.f90

  Log Message:
  -----------
  [MLIR][OpenMP] Emit nullary check for mapped pointer members and appropriate size select based on results (#124604)

This PR aims to fix a mapping error when trying to map nullary elements
of a record type (primary example is allocatables/pointer types in
Fortran at the moment). This should be legal to map, just not write to
without pointing to anything within the target region. A common Fortran
OpenMP idiom/example where this is useful can be found in the added
Fortran offload example.

The runtime error arises when we try to map the pointer member utilising
a prescribed constant size that we receive from the lowered type,
resulting in mapping of data that will be non-existent when there is no
allocated data. The fix in this case is to emit a runtime check to see
if the data has been allocated, if it hasn't been we select a size of 0,
if it has we emit the usual type size.



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