llvm-project
848d409e - [flang][OpenMP] Lower target in_reduction (#199967)

Commit
17 hours ago
[flang][OpenMP] Lower target in_reduction (#199967) This patch carries `in_reduction` through `omp.target` for host execution. The lowering looks up the task-reduction private storage with `__kmpc_task_reduction_get_th_data` and binds the target region argument to that private pointer. This makes uses inside the target region refer to the task-private reduction storage instead of continuing to use the original variable. This also fixes the `omp::TargetOp::build(TargetOperands)` path so `in_reduction` operands are preserved instead of being dropped. On the Flang side, `target in_reduction` list items are added to the target map entries when needed, giving the translation a matching mapped value to rewrite. ### Stack / review order This PR is related to the OpenMP task-reduction translation stack: 1. #199565 — `omp.taskgroup task_reduction` translation 2. #199670 — `omp.taskloop` `reduction` / `in_reduction` translation 3. #202611 — explicit `omp.task in_reduction` translation This PR is a target-specific sibling follow-up: * #199967 — `omp.target in_reduction` host lowering The intended main review order for the task/taskloop stack is: #199565 → #199670 → #202611 This PR should be reviewed as the `omp.target in_reduction` host-side lowering work built on the same task-reduction runtime model, not as a dependency of #202611. Addresses #199904. Assisted-by: Claude Opus 4.8 and ChatGPT 5.5
Author
Parents
Loading