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

Kareem Ergawy via flang-commits flang-commits at lists.llvm.org
Mon Oct 27 01:17:57 PDT 2025


ergawy wrote:

Thanks all for the feedback!

This is the most relevant part of the spec (5.2) according to which I think the changes in this PR are legal:
> 5.5.5 Properties Common to All Reduction Clauses
...
An original list item with the ALLOCATABLE attribute or any allocatable component of an
original list item that corresponds to a special variable identifier in the combiner expression or
the initializer expression must be in the allocated state at entry to the construct that contains the
reduction clause. Additionally, the list item or the allocatable component of the list item must be
neither deallocated nor allocated, explicitly or implicitly, within the region
...

OpenMP 6.0 maintains the same restriction.

@tblah @jeanPerier based on this and above comments, do you have objections to the changes in the PR? Please take another look and let me know.

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


More information about the flang-commits mailing list