[flang-commits] [flang] [flang][OpenMP] Add lowering of subroutine calls in custom reduction combiners (PR #169808)

Kareem Ergawy via flang-commits flang-commits at lists.llvm.org
Thu Nov 27 21:47:14 PST 2025


================
@@ -3586,19 +3587,32 @@ processReductionCombiner(lower::AbstractConverter &converter,
   const parser::OmpStylizedInstance::Instance &instance =
       std::get<parser::OmpStylizedInstance::Instance>(combinerInstance.t);
 
-  const auto *as = std::get_if<parser::AssignmentStmt>(&instance.u);
-  if (!as) {
-    TODO(converter.getCurrentLocation(),
-         "A combiner that is a subroutine call is not yet supported");
+  std::optional<semantics::SomeExpr> evalExprOpt;
+  if (const auto *as = std::get_if<parser::AssignmentStmt>(&instance.u)) {
+    auto &expr = std::get<parser::Expr>(as->t);
+    evalExprOpt = makeExpr(expr, semaCtx);
+  } else if (const auto *call = std::get_if<parser::CallStmt>(&instance.u)) {
+    if (call->typedCall) {
+      const auto &procRef = *call->typedCall;
+      evalExprOpt = semantics::SomeExpr{procRef};
+    } else {
+      TODO(converter.getCurrentLocation(),
+           "CallStmt without typedCall is not yet supported");
----------------
ergawy wrote:

Not a comment on the PR but a question: can someone explain what the concept of a "typed call" is? Why would not be filled in a `CallStmt`?

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


More information about the flang-commits mailing list