[all-commits] [llvm/llvm-project] 82e4e5: [OpenMP][Tools] Fix Archer for MACOS

Joachim via All-commits all-commits at lists.llvm.org
Wed Jun 9 04:38:42 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 82e4e505315b8df27e82c0e1cb9d5eb1aa7d45da
      https://github.com/llvm/llvm-project/commit/82e4e505315b8df27e82c0e1cb9d5eb1aa7d45da
  Author: Joachim Protze <protze at itc.rwth-aachen.de>
  Date:   2021-06-09 (Wed, 09 Jun 2021)

  Changed paths:
    M openmp/tools/archer/ompt-tsan.cpp

  Log Message:
  -----------
  [OpenMP][Tools] Fix Archer for MACOS

Archer uses weak symbol overloads of TSan functions to enable loading the tool
even if the application is not built with TSan. For MACOS the tool collects
the function pointer at runtime.
When adding the function entry/exit markers, we missed to add the functions
in the MACOS codepath.
This patch also replaces the repeated function lookup by a single initial
function lookup and fixes the disabling logic in RunningOnValgrind.

Differential Revision: https://reviews.llvm.org/D103607


  Commit: 08d8f1a958bd8be681e3e1f346be80818a83a556
      https://github.com/llvm/llvm-project/commit/08d8f1a958bd8be681e3e1f346be80818a83a556
  Author: Joachim Protze <protze at itc.rwth-aachen.de>
  Date:   2021-06-09 (Wed, 09 Jun 2021)

  Changed paths:
    M openmp/tools/archer/README.md
    M openmp/tools/archer/ompt-tsan.cpp
    M openmp/tools/archer/tests/lit.cfg

  Log Message:
  -----------
  [OpenMP][Tools] Cleanup memory pool used in Archer

The main motivation for reusing objects is that it helps to avoid creating and
leaking synchronization clocks in TSan. The reused object will reuse the
synchronization clock in TSan.

Before, new and delete operators were overloaded to get and return memory for
the object from/to the object pool.
This patch replaces the operator overloading with explicit static New/Delete
functions.

Objects for parallel regions and implicit tasks will always be recruited and
returned to the thread-local object pool. Only for explicit task, there is a
chance that an other thread completes the task and will free the object. This
patch optimizes the thread-local New/Delete calls by avoiding locks and only
lock if the pool is empty. Remote threads return the object into a separate
queue.

The chunk size for allocations is now decided based on page size. The objects
will also be aligned to cache lines avoiding false sharing.

This is the first patch in a series to provide better tasking support.

Differential Revision: https://reviews.llvm.org/D103606


  Commit: 639b3979310d8cec82b9b0a3ad3e64566244717f
      https://github.com/llvm/llvm-project/commit/639b3979310d8cec82b9b0a3ad3e64566244717f
  Author: Joachim Protze <protze at itc.rwth-aachen.de>
  Date:   2021-06-09 (Wed, 09 Jun 2021)

  Changed paths:
    M openmp/tools/archer/ompt-tsan.cpp

  Log Message:
  -----------
  [OpenMP][Tools] Fix Archer handling of task dependencies

The current handling of dependencies in Archer has two flaws:

- annotation of dependency synchronization is not limited to sibling tasks
- annotation of in/out dependencies is based on the assumption, that dependency
  variables will rarely be byte-sized variables.

This patch introduces a map in the generating task to manage the dependency
variables for the child tasks. The map is only accesses from the generating
task, so no locking is necessary. This also limits the dependency-based
synchronization to sibling tasks.
This patch also introduces proper handling for new dependency types such as
mutexinoutset and inoutset.

Differential Revision: https://reviews.llvm.org/D103608


Compare: https://github.com/llvm/llvm-project/compare/d96ea4662980...639b3979310d


More information about the All-commits mailing list