Unverified Commit 6f068b9c authored by Tom Eccles's avatar Tom Eccles Committed by GitHub
Browse files

[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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment