[flang][OpenMP] Allocate array reduction variables on the heap (#87773)
Following up on a review comment: https://github.com/llvm/llvm-project/pull/84958#discussion_r1527627848 Reductions might be inlined inside of a loop so stack allocations are not safe. Normally flang allocates arrays on the stack. Allocatable arrays have a different type: fir.box<fir.heap<fir.array<...>>> instead of fir.box<fir.array<...>>. This patch will allocate all arrays on the heap. Reductions on allocatable arrays still aren't supported (but I will get to this soon).
parent
eef63d3c
Please register or sign in to comment