[flang-commits] [flang] [flang][OpenMP] NFC: Extract intrinsic reduction shadow lookup (PR #218389)
via flang-commits
flang-commits at lists.llvm.org
Mon Aug 24 13:48:32 PDT 2026
================
@@ -93,6 +94,13 @@ class ReductionProcessor {
static bool
supportedIntrinsicProcReduction(const omp::clause::ProcedureDesignator &pd);
+ /// Find a user-defined reduction that shadows a supported intrinsic
----------------
MattPD wrote:
Could the doc comment state the contract of `findUserDefinedReductionForIntrinsic` more precisely? The function returns a user-defined reduction exactly when `processReductionArguments` would bind it instead of the supported intrinsic. Semantic visibility alone does not determine the result.
Two USE-associated `max` reductions for disjoint types are recorded as a name collision in `UseErrorDetails`. `FindUserReductionSymbol` still resolves the type-matching user-defined reduction. `findUserDefinedReductionForIntrinsic` returns null because its direct scope lookup stops at the collision. `processReductionArguments` therefore binds the supported intrinsic. This PR preserves that behavior, so I am asking only for a wording change to the doc comment.
[PR 215997](https://github.com/llvm/llvm-project/pull/215997) depends on that contract. It uses `findUserDefinedReductionForIntrinsic` to test whether `processReductionArguments` binds a user-defined reduction for each reduction clause.
https://github.com/llvm/llvm-project/pull/218389
More information about the flang-commits
mailing list