[flang-commits] [flang] [flang][OpenMP] Lower cross-module operator declare reduction (PR #207493)

Sairudra More via flang-commits flang-commits at lists.llvm.org
Sun Jul 5 21:29:12 PDT 2026


https://github.com/Saieiei requested changes to this pull request.

Thanks for the patch. The main mechanism looks good to me, but I found one ambiguity that should be handled before this starts lowering imported operator reductions.

If two imported, distinguishable user-defined operators are merged into one local operator, and both provide a declare reduction for the same type, this PR accepts the program with no diagnostic. In my local test, swapping only the USE order changed which combiner `reduction(.local.: x)` selected.

This looks like pre-existing resolver behavior, but this PR makes it reachable in codegen. Could we diagnose the ambiguity, or otherwise make the selection deterministic and order-independent? A test covering this would be useful.

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


More information about the flang-commits mailing list