Skip to content

Commit

Permalink
[NFC][flang][OpenMP] Add comment for handling the data race problem i…
Browse files Browse the repository at this point in the history
…n copyin clause

The reference and description is missed before.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D129437
  • Loading branch information
PeixinQiao committed Jul 12, 2022
1 parent 68cc1ee commit 1301995
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions flang/lib/Lower/OpenMP.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 1301995

Please sign in to comment.