[flang-commits] [flang] [mlir] [flang][openmp] Changes for invoking scan Op (PR #123254)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Thu Jan 23 03:48:31 PST 2025


================
@@ -649,6 +668,11 @@ void ReductionProcessor::addDeclareReduction(
                                   currentLocation, isByRef);
     reductionDeclSymbols.push_back(
         mlir::SymbolRefAttr::get(firOpBuilder.getContext(), decl.getSymName()));
+    auto redMod = std::get<std::optional<ReductionModifier>>(reduction.t);
+    if (redMod.has_value())
+      *reductionMod = mlir::omp::ReductionModifierAttr::get(
+          firOpBuilder.getContext(),
+          translateReductionModifier(redMod.value()));
----------------
skatrak wrote:

Nit: The modifier was already extracted above in this function.
```suggestion
    if (mod.has_value())
      *reductionMod = mlir::omp::ReductionModifierAttr::get(
          firOpBuilder.getContext(),
          translateReductionModifier(mod.value()));
```

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


More information about the flang-commits mailing list