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

Slava Zakharin via Openmp-commits openmp-commits at lists.llvm.org
Wed Nov 22 15:13:55 PST 2023

vzakhari wrote:

I think you would not have to bother about the disconnect if after the lowering the `map_info`'s reference the "locations" of the corresponding members via `varPtrPtr`.  As in my example:
%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 `%base_addr_addr` and `%addendum_addr_addr` are the addresses pointing into the original descriptor, i.e. they are the offsetted addresses starting from `%descAddr`.

Note that in this notation the `%0` and `%1` also follow their definition, i.e. that `varPtr` is mapped to the device and then attached into the device memory corresponding to `varPtrPtr`.  This is what effectively happens in the end, except that when they are used as `members` operands there are more actions that happen alongside, e.g. that the whole descriptor is mapped as well.


More information about the Openmp-commits mailing list