[flang-commits] [flang] [llvm] [mlir] [flang][OpenMP] Lower target in_reduction for host fallback (PR #199967)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Mon Jul 6 04:07:12 PDT 2026


================

----------------
skatrak wrote:

The gtid creation is an OMPIRBuilder task, we shouldn't be directly building LLVM IR here. The block outside of the loop and the loop itself should be part of the `createTargetInReduction` function, and possibly pass a lambda to it to allow mapping the map block arguments to the generated LLVM IR values. Just as we do it for other constructs using `bodyCB`.

I can see you've done this for other `in_reduction` cases, but I'd strongly suggest to revisit that design decision there as well (in a follow-up patch) and refactor that shared logic within the OMPIRBuilder, as it's currently breaking a previously established separation of responsibilities for no clear gain.

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


More information about the flang-commits mailing list