[flang-commits] [clang] [flang] [llvm] [mlir] [OpenMP][flang] Add initial support for by-ref reductions on the GPU (PR #165714)

Kareem Ergawy via flang-commits flang-commits at lists.llvm.org
Wed Nov 5 05:19:05 PST 2025


================
@@ -3728,7 +3812,8 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::createReductionsGPU(
   // Add emission of __kmpc_end_reduce{_nowait}(<gtid>);
   for (auto En : enumerate(ReductionInfos)) {
     const ReductionInfo &RI = En.value();
-    Value *LHS = RI.Variable;
+    Type *ValueType = RI.ElementType;
+    Value *RedValue = RI.Variable;
----------------
ergawy wrote:

To match the naming used in [CPU reduction](https://github.com/llvm/llvm-project/blob/main/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp#L3944).

I think `RedValue` gives more context for the code than just `LHS`.

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


More information about the flang-commits mailing list