[Openmp-commits] [mlir] [flang] [openmp] [Flang][OpenMP] Initial mapping of Fortran pointers and allocatables for target devices (PR #71766)

via Openmp-commits openmp-commits at lists.llvm.org
Tue Dec 5 11:17:48 PST 2023

agozillon wrote:

> Thanks @agozillon for making progress with this patch. I had a quick look. Will probably go through it again later today. The patch is still quite big and touches different portions. I guess to retain context it is still important to have it all in one place.

No problem @kiranchandramohan, thank you for the review and I'd love for you to go through it again whenever you have a spare moment, I am aware it's quite big unfortunately, but I think the majority of it is tests currently, which can perhaps be glossed over at least for an initial pass. It is important for context I think, but I'd be happy to break it into multiple PRs once it's been accepted if that's the desired direction, it might make it a little weird with the buildbots landing them all at once though as it's quite an interlinked PR unfortunately but it should be fine.  
> I was kind of thinking that by using `varPtrPtr` we will not require the members field. I should probably go back and look through the previous conversation. But a one or two or three line statement on the need for members would be useful.

I believe the previous conversation with @vzakhari still requires the usage of members, e.g.: 

> %0 = mapinfo varPtr(%base_addr) varPtrPtr(%base_addr_addr) (to)
> %1 = mapinfo varPtr(%addendum_addr) varPtrPtr(%addendum_addr_addr) (to)
> %2 = mapinfo varPtr(%descAddr) members(%0, %1) (to)

The best way to look at how it is currently done is that we're doing a record type mapping, as that's effectively what a box type becomes in LLVM IR, and to correctly bind things we have to map the parent (descriptor) and then attach any pointer elements it has so that the data can be accessed on device correctly via the mapped structure. This can be seen in the function `processMapWithMembersOf` which hopefully also helps lay some ground work for derived type struct + pointer member mapping cases.

However, It might be possible to map them without processMapWithMembersOf and members, I am not so sure however. If you want me to have a look in that direction to see if it is possible I could though! 


More information about the Openmp-commits mailing list