[flang-commits] [flang] [flang][cuda] Route dynamic autos through malloc_unified/free_unified (PR #212965)

via flang-commits flang-commits at lists.llvm.org
Fri Jul 31 05:40:56 PDT 2026


================
@@ -57,6 +57,13 @@ bool replaceAllocas(mlir::RewriterBase &rewriter, mlir::Operation *parentOp,
                     MustRewriteCallBack, AllocaRewriterCallBack,
                     DeallocCallBack);
 
+/// Under -gpu=mem:unified|managed, move the dynamically sized fir.alloca of
+/// \p func to fir.allocmem/fir.freemem pairs marked for the unified/managed
+/// allocator. Does nothing for device code, which keeps its stack allocations.
+/// Returns true if the function was modified.
+bool promoteDynamicAllocasToCudaHeap(mlir::RewriterBase &rewriter,
----------------
jeanPerier wrote:

Nit: since this only affects user variables, I would suggest renaming it to reflect that and/or to update the description here.

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


More information about the flang-commits mailing list