HomePhabricator

[OPENMP]Make __kmpc_push_tripcount thread safe.

Authored by ABataev on Jul 8 2019, 8:30 AM.

Description

[OPENMP]Make __kmpc_push_tripcount thread safe.

Summary:
__kmpc_push_tripcount function is not thread safe and may lead to data
race when the target regions are executed in parallel threads. The patch
makes loopTripCnt counter thread aware and stores the tripcount value
per thread in the map. Access to map is guarded by mutex to prevent
data race in the map itself.
Test is for NVPTX target because it does not work correctly on the
host. Seems to me, there is a problem in libomp with target regions in
the parallel threads.

Reviewers: grokos

Subscribers: guansong, jfb, jdoerfert, openmp-commits, kkwli0, caomhin

Tags: #openmp

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

llvm-svn: 365332

Details

Committed
ABataevJul 8 2019, 8:30 AM
Differential Revision
D64080: [OPENMP]Make __kmpc_push_tripcount thread safe.
Parents
rG4aa2873fdce5: [clangd] A code tweak to expand a macro
Branches
Unknown
Tags
Unknown