[flang-commits] [openmp] [mlir] [flang] [Flang][OpenMP] Initial mapping of Fortran pointers and allocatables for target devices (PR #71766)
via flang-commits
flang-commits at lists.llvm.org
Fri Nov 17 07:31:07 PST 2023
agozillon wrote:
> I was thinking about something like this:
>
> ```
> %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)
> ```
>
> So that `%0` and `%1` describe the map-and-attach actions for their parent data structure, whose mapping is described by `%2`. But, yes, this requires exposing the addresses of the `base_addr` and `addendum` members within the parent `!fir.ref<!fir.box<...`.
>
> This is just a suggestion.
Thank you @vzakhari, I think this is a good suggestion and I had something similar in mind, although I hadn't quite thought about using the varPtrPtr field quite yet, although, the additional use of it in this case is likely quite useful. I can look into converting this PR closer to this direction as it appears to be the more desired approach. I might end up having a couple of questions here and there on how to implement certain things, if that's alright! Still learning a lot about the infrastructure, in particular FIR/Flang level stuff (i.e. not too sure how to create the addr of addr's or expose the addresses of the members yet, but I am sure I'll work it out, although hints are always welcome),
https://github.com/llvm/llvm-project/pull/71766
More information about the flang-commits
mailing list