[flang-commits] [flang] [Flang] [OpenMP]Support for multiple types in declare_reduction (PR #179442)
via flang-commits
flang-commits at lists.llvm.org
Tue Feb 3 03:48:00 PST 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- flang/lib/Lower/OpenMP/OpenMP.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/flang/lib/Lower/OpenMP/OpenMP.cpp b/flang/lib/Lower/OpenMP/OpenMP.cpp
index d6539ceb8..04cca2f66 100644
--- a/flang/lib/Lower/OpenMP/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP/OpenMP.cpp
@@ -3884,8 +3884,7 @@ static void genOMP(lower::AbstractConverter &converter, lower::SymMap &symTable,
const auto &specifier =
DEREF(parser::omp::GetFirstArgument<parser::OmpReductionSpecifier>(
construct.v));
- const auto &typeNameList =
- std::get<parser::OmpTypeNameList>(specifier.t);
+ const auto &typeNameList = std::get<parser::OmpTypeNameList>(specifier.t);
List<Clause> clauses = makeClauses(construct.v.Clauses(), semaCtx);
const clause::Combiner &combiner =
appendCombiner(construct, clauses, semaCtx);
@@ -3896,16 +3895,16 @@ static void genOMP(lower::AbstractConverter &converter, lower::SymMap &symTable,
for (const auto &typeSpec : typeNameList.v) {
mlir::Type reductionType = getReductionType(converter, specifier);
-
+
ReductionProcessor::GenCombinerCBTy genCombinerCB =
processReductionCombiner(converter, symTable, semaCtx, combiner);
-
+
ReductionProcessor::GenInitValueCBTy genInitValueCB;
ClauseProcessor cp(converter, semaCtx, clauses);
cp.processInitializer(symTable, genInitValueCB);
bool isByRef = ReductionProcessor::doReductionByRef(reductionType);
-
+
ReductionProcessor::createDeclareReductionHelper<
mlir::omp::DeclareReductionOp>(
converter, reductionName.ToString(), reductionType,
``````````
</details>
https://github.com/llvm/llvm-project/pull/179442
More information about the flang-commits
mailing list