[flang-commits] [flang] [Flang][MIF] Adding support of intrinsics with coarray argument (PR #192944)

via flang-commits flang-commits at lists.llvm.org
Thu Jun 4 06:51:08 PDT 2026


https://github.com/jeanPerier commented:

Thanks for the update, that is an interesting approach I did not expect.
I can see why you can justify making fir.coarray a value type (as if it were a value whose SSA register is spit over all the different images), but I feel that in practice the coarray abstraction relates more to memory and how you access it than SSA values, so I would rather have this be a memory type like fir.box/class/ref...., or an attribute of such type that stores the corank. In general I think I would advocate against making it a new optional "stage" of the type nesting (regardless of whether it would wrap a FIR memory type or a FIR value type . My return of experience with having done that with ALLOCATALE/POINTER inside fir.box (by adding fir.ptr/fir.heap indirection before the value type) is that this brings more complexity ambiguity than having a fir.box_ptr of attribute.

In any case, I think this is a design choice that deserve a small design write ups with usages/motivation/alternative to select the solution. I am not requesting you to introduce the new type here, I am fine with having the corank attribute set on the operation whose codegen requires it instead of trying to retrieve it from fir.box_addr and al. for now. My main grudge was that codegen that retrieve things via getDefiningOp tends to break in the long run.

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


More information about the flang-commits mailing list