Skip to content

Commit

Permalink
[OpenMP][Tools] Fix handling of initial-task-end
Browse files Browse the repository at this point in the history
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.

Reviewed By: dreachem

Differential Revision: https://reviews.llvm.org/D114005
  • Loading branch information
jprotze authored and chichunchen committed Mar 31, 2022
1 parent 1a6aa8b commit 7641e42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openmp/tools/archer/ompt-tsan.cpp
Expand Up @@ -686,10 +686,10 @@ static void ompt_tsan_implicit_task(ompt_scope_endpoint_t endpoint,
#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;
}
Expand Down

0 comments on commit 7641e42

Please sign in to comment.