[all-commits] [llvm/llvm-project] c3847f: [mlir][OpenMP] Translate task_reduction on taskgroup

Sairudra More via All-commits all-commits at lists.llvm.org
Thu May 28 04:54:20 PDT 2026


  Branch: refs/heads/users/saieiei/target-in-reduction
  Home:   https://github.com/llvm/llvm-project
  Commit: c3847fed57dfdc41061291b90c6e6ca1ff950d28
      https://github.com/llvm/llvm-project/commit/c3847fed57dfdc41061291b90c6e6ca1ff950d28
  Author: saieiei <sairudra60 at gmail.com>
  Date:   2026-05-28 (Thu, 28 May 2026)

  Changed paths:
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
    A mlir/test/Target/LLVMIR/openmp-taskgroup-task-reduction.mlir
    M mlir/test/Target/LLVMIR/openmp-todo.mlir

  Log Message:
  -----------
  [mlir][OpenMP] Translate task_reduction on taskgroup

Add LLVM IR translation support for the task_reduction clause on
omp.taskgroup.

The translation builds task-reduction descriptors for the listed reduction
variables and emits the runtime initialization before the taskgroup body.
The reducer init and combiner callbacks are generated from the corresponding
omp.declare_reduction regions.

This patch keeps taskloop reduction and in_reduction translation unsupported;
those remain follow-up work. Unsupported task_reduction forms are diagnosed
instead of being lowered incorrectly.

Add MLIR translation tests for taskgroup task_reduction, multiple reducers,
plain taskgroup translation, and remaining unsupported cases.


  Commit: 1ca9edc6fc44ae75eda94bf65e0cd4d2bca2620c
      https://github.com/llvm/llvm-project/commit/1ca9edc6fc44ae75eda94bf65e0cd4d2bca2620c
  Author: Sairudra More <moresair at pe31.hpc.amslabs.hpecorp.net>
  Date:   2026-05-28 (Thu, 28 May 2026)

  Changed paths:
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
    A mlir/test/Target/LLVMIR/openmp-taskloop-reduction.mlir
    M mlir/test/Target/LLVMIR/openmp-todo.mlir

  Log Message:
  -----------
  [mlir][OpenMP] Translate reductions on taskloop

Add LLVM IR translation for reduction and in_reduction clauses on omp.taskloop.context.

For taskloop reduction, emit the implicit taskgroup reduction setup and map each generated task to runtime-provided private reduction storage through __kmpc_task_reduction_get_th_data. For in_reduction, use the same runtime lookup path with a null descriptor to join an enclosing task reduction context.

Unsupported byref, cleanup, and two-argument initializer forms remain diagnosed.

Add MLIR translation tests for the supported taskloop reduction and in_reduction cases.


  Commit: 960e149fc2386c531a5b53c5c0798de4c7d66d7f
      https://github.com/llvm/llvm-project/commit/960e149fc2386c531a5b53c5c0798de4c7d66d7f
  Author: Sairudra More <sairudra60 at gmail.com>
  Date:   2026-05-28 (Thu, 28 May 2026)

  Changed paths:
    M flang/lib/Lower/OpenMP/OpenMP.cpp
    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 mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
    M mlir/test/Dialect/OpenMP/invalid.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 for host fallback

Teach Flang lowering and MLIR OpenMP translation to carry
in_reduction through omp.target for the host-fallback path.

The translation looks up task reduction-private storage with
__kmpc_task_reduction_get_th_data and binds the target region's
in_reduction block argument to that private pointer, so uses inside the
region do not keep referring to the original variable.

The patch also preserves in_reduction operands in the TargetOp builder
path and ensures target in_reduction list items are mapped into the
target region when needed.

The device/offload-entry path remains diagnosed as not yet implemented.


Compare: https://github.com/llvm/llvm-project/compare/753008ddd06a...960e149fc238

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