[Openmp-commits] [PATCH] D123444: [OpenMP][FIX] Simplify the entry deletion scheme

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Apr 8 22:14:34 PDT 2022


jdoerfert created this revision.
jdoerfert added reviewers: ye-luo, JonChesterfield, jhuber6, tianshilei1992.
Herald added subscribers: guansong, bollu, yaxunl.
Herald added a project: All.
jdoerfert requested review of this revision.
Herald added a subscriber: sstefan1.
Herald added a project: OpenMP.

The scheme introduced with D121058 <https://reviews.llvm.org/D121058> did not work properly. There are
three reasons, tow are fixed here:

1. The thread ID scheme is not needed and can result in dangling pointers if the thread in charge is faster than another one interested in deletion. We now keep the entry until the last thread that wants to delete the entry makes it to the deletion point.
2. The PostProcessingPtrs set can contain an entry multiple times. The deletion can happen before we visit the entry again in a subsequent iteration. That resulted again in a dangling pointer. We track the deleted entries now to avoid this.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D123444

Files:
  openmp/libomptarget/include/device.h
  openmp/libomptarget/src/omptarget.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123444.421687.patch
Type: text/x-patch
Size: 6440 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220409/6554206d/attachment.bin>


More information about the Openmp-commits mailing list