[all-commits] [llvm/llvm-project] 3a7188: [flang][OpenMP] Map device pointers on host device...

Krzysztof Parzyszek via All-commits all-commits at lists.llvm.org
Tue Jun 24 13:38:44 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3a71884ab1a508aed6e3e2fd79a83e7d70f34784
      https://github.com/llvm/llvm-project/commit/3a71884ab1a508aed6e3e2fd79a83e7d70f34784
  Author: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
  Date:   2025-06-24 (Tue, 24 Jun 2025)

  Changed paths:
    A flang/test/Lower/OpenMP/target-data-if-false.f90
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp

  Log Message:
  -----------
  [flang][OpenMP] Map device pointers on host device as well (#145562)

Given a TARGET DATA construct with USE_DEVICE_PTR(x) and IF(FALSE), the
compiler will crash if `x` was used in the body. The cause of the crash
is that the MLIR->LLVM codegen tries to look up the translated value of
x, but one had not been mapped.

Given an IF clause, the translation will generate an if-then-else
construct, with the "else" block corresponding to the false condition,
i.e. the host device playing the role of the target device. In that
block, still process the USE_DEVICE_ADDR/USE_DEVICE_PTR clauses, which
will cause the translation mappings to be created.

Fixes https://github.com/llvm/llvm-project/issues/145558



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