[flang-commits] [flang] [flang][OpenMP] Allocate `allocatable` init temps on the stack for GPUs (PR #164761)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Thu Oct 23 03:22:06 PDT 2025


https://github.com/tblah approved this pull request.

I'm a little surprised that this is allowed in Fortran but so far as I can tell the Fortran standard does not actually require ALLOCATABLEsto be allocated on the heap so long as the allocation lifetime required by the standard is obeyed.

I agree the case of a private variable, the expected lifetime is the duration of the outlined openmp construct and so a stack allocation should give us the correct lifetime.

Please wait for a second opinion on this before merging.

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


More information about the flang-commits mailing list