HomePhabricator

[OpenMP] Fix data-race in new device RTL

Authored by jhuber6 on Sep 23 2021, 2:18 PM.

Description

[OpenMP] Fix data-race in new device RTL

This patch fixes a data-race observed when using the new device runtime
library. The Internal control variable for the parallel level is read in
the __kmpc_parallel_51 function while it could potentially be written
by other threads. This causes data corruption and will cause
nondetermistic behaviour in the runtime. This patch fixes this by adding
an explicit synchronization before the region starts.

Reviewed By: jdoerfert

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

Details

Committed
jhuber6Sep 23 2021, 2:28 PM
Reviewer
jdoerfert
Differential Revision
D110366: [OpenMP] Fix data-race in new device RTL
Parents
rG2875d3d484bb: RegAllocGreedy: Remove an unhelpful auto, and don't use a reference
Branches
Unknown
Tags
Unknown