You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Flang][OpenMP] Fix for regression of smoke test flang-325095
When it comes to assumed size/shape/allocatables/anything tied to a descriptor that's
used in a use_addr/ptr of a target data we need to emit an implicit map of the
descriptor for the directive to be sure the descriptor data is also on device for the
subsequent target data, as we're going to effectively be generating an access to the
device descriptor for the duration of the target region, not just to access the data
but also to generate accesses to the data via the descriptor bounds information, if
it's not present, we don't perform the correct data accesses, which can result in writing
to only the first index of the data or even not writing the data to any index. So we need
to be sure we have the apporpriate descriptor information on device.
This PR does that by adding a descriptor implicit map addition to MapInfoFinalization for
target data when an descriptor type is found in a use_device_addr/ptr clause, and then a
modification to the later lowering in OpenMPtoLLVMIRTranslation to make the duplicate map
check a little more restrictive, to prevent it miscategorizing the regular descriptor map
as a duplicate mapping to the use_device_addr/ptr map, as they aren't the same, one is just
the descriptor, the other is the full descriptor/data member map done for
use_device_ptr/addr (so not mapping the data). It might be possible to do it differently
by "merging" the closely aligned entries, and making sure we don't lose the member maps and
adjust the map types to reflect a combination of the solo descriptor map and
use_device_addr/ptr map but this might be a bit more complicated and error prone versus
tightening up the restriction on what's considered a duplicate entry.
0 commit comments