[flang-commits] [flang] [flang][OpenMP] Support ALLOCATABLE list items in LINEAR (PR #228827)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Mon Oct 12 02:11:54 PDT 2026


tblah wrote:

Design sounds good to me

> Open point: the translation can't look inside a Fortran descriptor, so it needs a way to get the data address. One option is a small optional region on the recipe or on the clause that yields it, which flang would fill with fir.load + fir.box_addr

This is the best approach because we want to avoid making the MLIR portion be flang specific. There are already some uses of the openmp dialect from other dialects (most importantly, clang-ir).

> Does linear carrying a privatizer recipe sound right to you? Should it be limited to descriptor types for now, or should all linear items move to it eventually?

Personally I would prefer the consistency if everything worked the same way (reductions also work the same way with the same initialization and deallocation code generated). If you would prefer to keep your patch series only to boxes then that is okay for now.

> Should the data-address region live on omp.private or on the linear clause? Or would you prefer the no-dialect-change route?

I don't have a strong opinion here. I guess `omp.private` because that would print better for human readers than trying to put something in the linear clause. There is already an optional `copy` region only used for `type = firstprivate` so we could have a data address region for `type = linear` (if I ever get around to it I also want to merge the reduction declare op and the private declare op - keeping the design for omp.private - so that `type = reduction` gets a `combiner` region).

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


More information about the flang-commits mailing list