[OpenMP] Sync writes to child thread's data before reduction
authorBryan Chan <bryan.chan@huawei.com>
Mon, 6 Apr 2020 22:43:35 +0000 (18:43 -0400)
committerBryan Chan <bryan.chan@huawei.com>
Tue, 14 Apr 2020 18:31:06 +0000 (14:31 -0400)
commitb86ff5f6efbed626fee135ae11311569d84b1e15
tree4b7594090c653b77c768612df61caa328ece4091
parent15754acc5985188509f5eefaefa308393759b822
[OpenMP] Sync writes to child thread's data before reduction

On systems with weak memory consistency, this patch fixes an intermittent crash
in the reduction function called by __kmp_hyper_barrier_gather, which suffers
from a race on a child thread's data.

Reviewed-By: AndreyChurbanov
Differential Revision: https://reviews.llvm.org/D77603
openmp/runtime/src/kmp_barrier.cpp