[all-commits] [llvm/llvm-project] 03552b: [flang][OpenMP] Lower target in_reduction

Sairudra More via All-commits all-commits at lists.llvm.org
Mon Jul 13 07:27:36 PDT 2026


  Branch: refs/heads/users/saieiei/target-in-reduction
  Home:   https://github.com/llvm/llvm-project
  Commit: 03552bc49f3fab632048bad1e661c348c94a68ec
      https://github.com/llvm/llvm-project/commit/03552bc49f3fab632048bad1e661c348c94a68ec
  Author: Sairudra More <sairudra60 at gmail.com>
  Date:   2026-07-13 (Mon, 13 Jul 2026)

  Changed paths:
    M flang/lib/Lower/OpenMP/OpenMP.cpp
    A flang/test/Integration/OpenMP/target-inreduction-llvmir.f90
    A flang/test/Lower/OpenMP/Todo/target-inreduction-common.f90
    A flang/test/Lower/OpenMP/Todo/target-inreduction-equivalence.f90
    A flang/test/Lower/OpenMP/Todo/target-inreduction-firstprivate.f90
    R flang/test/Lower/OpenMP/Todo/target-inreduction.f90
    A flang/test/Lower/OpenMP/target-inreduction-unused.f90
    A flang/test/Lower/OpenMP/target-inreduction.f90
    M llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
    M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
    M mlir/include/mlir/Dialect/OpenMP/OpenMPClauses.td
    M mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
    M mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
    M mlir/test/Dialect/OpenMP/host-op-filtering.mlir
    M mlir/test/Dialect/OpenMP/invalid.mlir
    A mlir/test/Target/LLVMIR/openmp-target-in-reduction-device.mlir
    A mlir/test/Target/LLVMIR/openmp-target-in-reduction-multi.mlir
    A mlir/test/Target/LLVMIR/openmp-target-in-reduction.mlir
    M mlir/test/Target/LLVMIR/openmp-todo.mlir

  Log Message:
  -----------
  [flang][OpenMP] Lower target in_reduction

Enable host lowering for target in_reduction in Flang and MLIR OpenMP
translation.

Model target in_reduction through the matching map entry, force
address-preserving implicit mapping for Flang in_reduction list items, and emit
the host-side task-reduction lookup with __kmpc_task_reduction_get_th_data. The
runtime entry point takes and returns a generic, default-address-space pointer,
so normalize a non-default-address-space captured pointer to the generic address
space before the call and cast the returned private pointer back to the map
block argument's address space, mirroring the in_reduction handling on
omp.taskloop. On the target device, in_reduction is handled as a regular
map(tofrom) variable. The byref modifier, two-argument initializers, cleanup
regions, and the remaining Flang COMMON/EQUIVALENCE/privatized-variable cases
continue to be diagnosed.

Add Flang lowering, MLIR verifier/translation, and LLVM IR tests for the
supported host path, including a non-default-address-space case, and the
remaining unsupported cases.



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