[flang-commits] [flang] [flang][OpenMP] Fix ICE lowering user-defined operator declare reduction (PR #204730)
via flang-commits
flang-commits at lists.llvm.org
Thu Jun 18 23:09:45 PDT 2026
MattPD wrote:
For context, since you've been reviewing the semantic side (#200329):
This PR can be independently merged first. It fixes the local user-defined operator reduction and replaces the crash for the remaining cases (USE-associated, renamed/merged, multi-type) with a clean TODO. Those are deliberately conservative, because the naive alternative (mangling the op name from the use-site spelling) silently binds the wrong combiner when two modules share an operator spelling. Cross-module support will come as a separate follow-up (a new PR on top of #200329), reusing its `FindUserReduction`/`SourceReductionName` resolution instead of re-mangling from the use site.
One soundness point that I'd appreciate feedback on: Directive and clause now name the `declare_reduction` op via `mangleName(reductionSym)` in lockstep, so same-spelling operators in different modules don't collide. Since the verifier doesn't type-check these ops (accumulator type is null without an atomic region), the clause-side type guard is the only thing preventing a wrong-typed combiner bind. If you see a better factoring or a hole in that guard, I'd be happy to adjust!
https://github.com/llvm/llvm-project/pull/204730
More information about the flang-commits
mailing list