[Openmp-commits] [PATCH] D158170: [OpenMP][Archer] Avoid false positive for OpenMP tasking

Joachim Protze via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Aug 17 03:47:39 PDT 2023


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

OpenMP tasks can be understood as asynchronous function calls where `shared` variables are passed by reference and `firstprivate` variables are passed by value. The OpenMP runtime needs to store these arguments from the instantiation/creation to the asynchronous execution. libomp stores these values along with the internal task data structure that is allocated from the internal memory manager.
During task creation, compiler generated code copies the values into the task object. At the beginning of task execution, compiler generated loads these values to the stack. Due to the memory management, the task object will be reused after the task finished execution. The load during task execution is not synchronized by OpenMP semantics with the store during task creation with reused task object. The memory manager provides the synchronization.

The newly added test demonstrates the false positive report with current LLVM.

This patch adds annotation for the //new// semantics of the task object. The patch depends on two other patches for TSan runtime and OpenMP runtime.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158170

Files:
  openmp/tools/archer/ompt-tsan.cpp
  openmp/tools/archer/tests/task/reuse-task-storage.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158170.551071.patch
Type: text/x-patch
Size: 4095 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230817/3b1bda86/attachment.bin>


More information about the Openmp-commits mailing list