[flang-commits] [flang] [flang] Restrict O0 hlfir.assign scalar-to-array inlining to OpenMP target device (PR #201774)

Sairudra More via flang-commits flang-commits at lists.llvm.org
Sat Jun 6 10:54:12 PDT 2026


================
@@ -0,0 +1,18 @@
+! Regression test for PR llvm/llvm-project#197092 and its follow-up.
+!
+! When compiling for an OpenMP target device at -O0, a scalar-to-array
+! broadcast assignment inside a target region must still be inlined to
+! avoid emitting a _FortranAAssign runtime call (which internally uses
+! malloc/free) into GPU device code.
+
+! RUN: %flang_fc1 -emit-fir -O0 -fopenmp -fopenmp-is-target-device %s -o - \
----------------
Saieiei wrote:

Yes, will keep that in mind

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


More information about the flang-commits mailing list