forked from OSchip/llvm-project
[NFC][flang][OpenMP] Add comment for handling the data race problem in copyin clause
The reference and description is missed before. Reviewed By: kiranchandramohan Differential Revision: https://reviews.llvm.org/D129437
This commit is contained in:
parent
68cc1eeb1d
commit
13019955bf
|
@ -228,6 +228,11 @@ genCopyinClause(Fortran::lower::AbstractConverter &converter,
|
|||
}
|
||||
}
|
||||
}
|
||||
// [OMP 5.0, 2.19.6.1] The copy is done after the team is formed and prior to
|
||||
// the execution of the associated structured block. Emit implicit barrier to
|
||||
// synchronize threads and avoid data races on propagation master's thread
|
||||
// values of threadprivate variables to local instances of that variables of
|
||||
// all other implicit threads.
|
||||
if (hasCopyin)
|
||||
firOpBuilder.create<mlir::omp::BarrierOp>(converter.getCurrentLocation());
|
||||
firOpBuilder.restoreInsertionPoint(insPt);
|
||||
|
|
Loading…
Reference in New Issue