[flang-commits] [flang] [lib] [OpenMC] Use references instead of pointers (PR #86000)

via flang-commits flang-commits at lists.llvm.org
Wed Mar 20 13:06:15 PDT 2024


https://github.com/matricate created https://github.com/llvm/llvm-project/pull/86000

None

>From f35aea70585eb12252d0377e5d0048e3882b5890 Mon Sep 17 00:00:00 2001
From: matricate <164239844+matricate at users.noreply.github.com>
Date: Wed, 20 Mar 2024 20:05:58 +0000
Subject: [PATCH] [lib] [OpenMC] Use references instead of pointers

---
 flang/lib/Lower/OpenMP/ReductionProcessor.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/flang/lib/Lower/OpenMP/ReductionProcessor.cpp b/flang/lib/Lower/OpenMP/ReductionProcessor.cpp
index 2477f635792a25..8d1e5c06dc16a0 100644
--- a/flang/lib/Lower/OpenMP/ReductionProcessor.cpp
+++ b/flang/lib/Lower/OpenMP/ReductionProcessor.cpp
@@ -457,8 +457,8 @@ mlir::omp::DeclareReductionOp ReductionProcessor::createDeclareReduction(
                       {loc, loc});
 
   builder.setInsertionPointToEnd(&decl.getReductionRegion().back());
-  mlir::Value op1 = decl.getReductionRegion().front().getArgument(0);
-  mlir::Value op2 = decl.getReductionRegion().front().getArgument(1);
+  mlir::Value &op1 = decl.getReductionRegion().front().getArgument(0);
+  mlir::Value &op2 = decl.getReductionRegion().front().getArgument(1);
   genCombiner(builder, loc, redId, type, op1, op2, isByRef);
 
   return decl;



More information about the flang-commits mailing list