This patch is an attempt to do for targetDataBegin what D104924 does
for targetDataEnd:
- Eliminates a lock/unlock of the data mapping table.
- Clarifies the logic that determines whether a struct member's host-to-device transfer occurs. The old logic, which checks the parent struct's reference count, is a leftover from back when we had a different map interface (as pointed out at https://reviews.llvm.org/D104924#2846972).
Additionally, it eliminates the DeviceTy::getMapEntryRefCnt, which
is no longer used after this patch.
While D104924 does not change the computation of IsLast, I found I
needed to change the computation of IsNew for this patch. As far as
I can tell, the change is correct, and this patch does not cause any
additional openmp tests to fail. However, I'm not sure I've thought
of all use cases. Please advise.
What is the meaning of these flags?
In code like the following, the target region should not copy any data, because S is already mapped in the enter data