[all-commits] [llvm/llvm-project] b7edea: [flang][OpenMP] Fix host-associated user-defined o...
Carlos Seo via All-commits
all-commits at lists.llvm.org
Wed Jul 8 10:03:01 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b7edea5afa0fef26054a491413a62eb3d35e7d2b
https://github.com/llvm/llvm-project/commit/b7edea5afa0fef26054a491413a62eb3d35e7d2b
Author: Carlos Seo <carlos.seo at linaro.org>
Date: 2026-07-08 (Wed, 08 Jul 2026)
Changed paths:
M flang/lib/Semantics/check-omp-structure.cpp
A flang/test/Lower/OpenMP/declare-reduction-operator-host-assoc.f90
Log Message:
-----------
[flang][OpenMP] Fix host-associated user-defined operator reduction (#207413)
A DECLARE REDUCTION for a user-defined operator (e.g.
reduction(.myadd.:x)) was rejected with "Invalid reduction operator in
REDUCTION clause" when the operator was host-associated.
CheckReductionOperator looked up the mangled reduction name in the scope
that owns the operator symbol (the scope where the operator interface is
declared) instead of the scope where the reduction clause appears. The
user-defined reduction is stored in the latter (a child scope), so the
lookup in the operator's owning scope could not find it and the clause
was reported as invalid.
Look up the reduction in the scope of the clause via
context_.FindScope(source). FindUserReduction already searches enclosing
scopes, so this both finds a locally declared reduction and continues to
find one that is host- or use-associated. The lowering side already
resolves the reduction in the current scope, so no lowering change is
needed.
This is a follow-up of PR #202474.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list