[flang-commits] [flang] [mlir] [flang][OpenMP] Lower target in_reduction for host fallback (PR #199967)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Tue Jun 23 06:55:11 PDT 2026


================
@@ -3166,14 +3189,32 @@ genTargetOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
       if (auto refType = mlir::dyn_cast<fir::ReferenceType>(baseOp.getType()))
         eleType = refType.getElementType();
 
+      // `target in_reduction` list items must keep the original variable
+      // address (ByRef + implicit tofrom) so the runtime lookup receives the
+      // variable address; all other implicit captures follow the scalar
+      // default mapping rules.
       std::pair<mlir::omp::ClauseMapFlags, mlir::omp::VariableCaptureKind>
-          mapFlagAndKind = getImplicitMapTypeAndKind(
-              firOpBuilder, converter, defaultMaps, eleType, loc, sym);
+          mapFlagAndKind =
----------------
skatrak wrote:

Nit: Use `if-else` to initialize `mapFlagAndKind` for readability.

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


More information about the flang-commits mailing list