[flang-commits] [flang] [llvm] [flang][OpenMP] Fix mapping of constant arrays. (PR #176763)

Pranav Bhandarkar via flang-commits flang-commits at lists.llvm.org
Tue Jan 20 09:45:53 PST 2026


================
@@ -2657,8 +2662,10 @@ genTargetOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
     if (!converter.getSymbolAddress(sym))
       return;
 
-    // Skip parameters/constants as they do not need to be mapped.
-    if (semantics::IsNamedConstant(sym))
+    // Skip scalar parameters/constants as they do not need to be mapped.
+    // However, parameter arrays must be mapped as they may be accessed with
+    // dynamic indices on the device (e.g., const_array(runtime_index)).
+    if (semantics::IsNamedConstant(sym) && sym.Rank() == 0)
----------------
bhandarkar-pranav wrote:

LGTM, @abidh thank you for handling this case.

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


More information about the flang-commits mailing list