[Openmp-commits] [PATCH] D105947: [libomptarget] Keep the Shadow Pointer Map up-to-date

Joel E. Denny via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Jul 14 05:54:32 PDT 2021


jdenny accepted this revision.
jdenny added a comment.
This revision is now accepted and ready to land.

Other than my comment suggestion, LGTM. Thanks.



================
Comment at: openmp/libomptarget/src/omptarget.cpp:569
+      // contains a stale entry, we need to update it (e.g. if the pointee was
+      // deallocated and later on is reallocated at another device address).
+      if (Entry == Device.ShadowPtrMap.end() ||
----------------
Can you extend this comment a bit more to address @tianshilei1992's question? That is, explain that the shadow map entry is added/removed only when the PTR is allocated/deallocated on the device, but TgtPtrVal becomes stale when the OBJ is allocated/deallocated on the device. I found this point confusing as well.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105947/new/

https://reviews.llvm.org/D105947



More information about the Openmp-commits mailing list