[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:10 PDT 2026


================
@@ -3132,7 +3154,8 @@ genTargetOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
     // dynamic indices on the device (e.g., const_array(runtime_index)).
     // Also, character scalar parameters must be mapped if they have dynamic
     // substring access.
-    if (semantics::IsNamedConstant(sym) && sym.Rank() == 0 &&
+    if (!forceAddressPreserving && semantics::IsNamedConstant(sym) &&
----------------
skatrak wrote:

Is this change necessary? I would expect `in_reduction(const_var)` to not be allowed anyways.

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


More information about the flang-commits mailing list