[Openmp-commits] [PATCH] D114005: [OpenMP][Tools] Fix handling of initial-task-end

Joachim Protze via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Nov 16 08:21:57 PST 2021


protze.joachim created this revision.
protze.joachim added a reviewer: dreachem.
protze.joachim added a project: OpenMP.
Herald added subscribers: guansong, yaxunl.
protze.joachim requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

Latest OpenMP spec says parallel_data is NULL for initial/implicit-task-end. 
We nevertheless need to cleanup the ParallelData here, as there is no other
callback for the end of the implicit parallel region. We can use the reference
stored in the TaskData.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114005

Files:
  openmp/tools/archer/ompt-tsan.cpp


Index: openmp/tools/archer/ompt-tsan.cpp
===================================================================
--- openmp/tools/archer/ompt-tsan.cpp
+++ openmp/tools/archer/ompt-tsan.cpp
@@ -686,10 +686,10 @@
 #endif
     assert(Data->RefCount == 1 &&
            "All tasks should have finished at the implicit barrier!");
-    Data->Delete();
     if (type & ompt_task_initial) {
-      ToParallelData(parallel_data)->Delete();
+      Data->Team->Delete();
     }
+    Data->Delete();
     TsanFuncExit();
     break;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114005.387653.patch
Type: text/x-patch
Size: 523 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20211116/cfdcb6a0/attachment-0001.bin>


More information about the Openmp-commits mailing list