[llvm-branch-commits] [mlir] [mlir][OpenMP] Translate explicit task in_reduction (PR #202611)

Sairudra More via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jun 16 02:05:09 PDT 2026


Saieiei wrote:

> where the "task in_reduction" construct is not lexically nested inside the taskgroup?

@dreachem I checked the runtime behavior for the orphaned-looking case. With a NULL descriptor, `__kmpc_task_reduction_get_th_data` walks the dynamic current-taskgroup chain from `th_current_task->td_taskgroup` through parent taskgroups.

So a task that is not lexically nested inside the `taskgroup task_reduction` can still be valid if it is dynamically/interprocedurally enclosed by a matching task reduction context. Clang does not diagnose this locally either.

Because of that, I did not add a translation-time verifier/diagnostic here. It could reject valid dynamic cases. A stricter missing-enclosing-context diagnostic would be better handled as a front-end/semantic follow-up if needed.


https://github.com/llvm/llvm-project/pull/202611


More information about the llvm-branch-commits mailing list