[all-commits] [llvm/llvm-project] 216223: [mlir][OpenMP] Translate explicit task in_reductio...

Sairudra More via All-commits all-commits at lists.llvm.org
Thu Jun 18 23:15:27 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 21622397c16f65d00361cd883c769189b06df13c
      https://github.com/llvm/llvm-project/commit/21622397c16f65d00361cd883c769189b06df13c
  Author: Sairudra More <sairudra60 at gmail.com>
  Date:   2026-06-19 (Fri, 19 Jun 2026)

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

  Log Message:
  -----------
  [mlir][OpenMP] Translate explicit task in_reduction (#202611)

Lower `in_reduction` on explicit `omp.task` operations to LLVM IR.

Inside the outlined task body, obtain the executing thread's `gtid` and call `__kmpc_task_reduction_get_th_data` with a null descriptor and the original reduction variable address. This lets the runtime find the enclosing taskgroup reduction registration and return the per-task private reduction storage.

The `in_reduction` block arguments are remapped to the returned private storage, so updates inside the explicit task body target the task-private reduction copy instead of the original shared variable.

Unsupported cases remain guarded, including byref `in_reduction` and richer `declare_reduction` forms such as two-argument initializers, cleanup regions, and missing combiners.



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