[flang-commits] [flang] [flang] Do not honor -fstack-arrays inside offload regions (PR #227537)

Zhen Wang via flang-commits flang-commits at lists.llvm.org
Wed Sep 30 09:55:35 PDT 2026


================
@@ -152,6 +154,10 @@ void AllocationPlacementPass::runOnOperation() {
                                smallArrayThresholdBytes);
   fir::overrideIfExplicitlySet(basePolicy.totalStackLimitBytes,
                                totalStackLimitBytes);
+  // An acc routine is compiled for the device as well, so -fstack-arrays
+  // cannot be honored in it, as in a device procedure.
+  if (mlir::acc::isAccRoutine(func))
+    basePolicy.stackArrays = false;
----------------
wangzpgi wrote:

Done. Lowering now records the device policy on the routine in `attachRoutineInfo`.

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


More information about the flang-commits mailing list