@@ -3984,6 +3984,7 @@ static void emitOMPAtomicReadExpr(CodeGenFunction &CGF, bool IsSeqCst,
3984
3984
if (IsSeqCst)
3985
3985
CGF.CGM .getOpenMPRuntime ().emitFlush (CGF, llvm::None, Loc);
3986
3986
CGF.emitOMPSimpleStore (VLValue, Res, X->getType ().getNonReferenceType (), Loc);
3987
+ CGF.CGM .getOpenMPRuntime ().checkAndEmitLastprivateConditional (CGF, V);
3987
3988
}
3988
3989
3989
3990
static void emitOMPAtomicWriteExpr (CodeGenFunction &CGF, bool IsSeqCst,
@@ -3992,6 +3993,7 @@ static void emitOMPAtomicWriteExpr(CodeGenFunction &CGF, bool IsSeqCst,
3992
3993
// x = expr;
3993
3994
assert (X->isLValue () && " X of 'omp atomic write' is not lvalue" );
3994
3995
emitSimpleAtomicStore (CGF, IsSeqCst, CGF.EmitLValue (X), CGF.EmitAnyExpr (E));
3996
+ CGF.CGM .getOpenMPRuntime ().checkAndEmitLastprivateConditional (CGF, X);
3995
3997
// OpenMP, 2.12.6, atomic Construct
3996
3998
// Any atomic construct with a seq_cst clause forces the atomically
3997
3999
// performed operation to include an implicit flush operation without a
@@ -4148,6 +4150,7 @@ static void emitOMPAtomicUpdateExpr(CodeGenFunction &CGF, bool IsSeqCst,
4148
4150
};
4149
4151
(void )CGF.EmitOMPAtomicSimpleUpdateExpr (
4150
4152
XLValue, ExprRValue, BOUE->getOpcode (), IsXLHSInRHSPart, AO, Loc, Gen);
4153
+ CGF.CGM .getOpenMPRuntime ().checkAndEmitLastprivateConditional (CGF, X);
4151
4154
// OpenMP, 2.12.6, atomic Construct
4152
4155
// Any atomic construct with a seq_cst clause forces the atomically
4153
4156
// performed operation to include an implicit flush operation without a
@@ -4214,6 +4217,7 @@ static void emitOMPAtomicCaptureExpr(CodeGenFunction &CGF, bool IsSeqCst,
4214
4217
};
4215
4218
auto Res = CGF.EmitOMPAtomicSimpleUpdateExpr (
4216
4219
XLValue, ExprRValue, BOUE->getOpcode (), IsXLHSInRHSPart, AO, Loc, Gen);
4220
+ CGF.CGM .getOpenMPRuntime ().checkAndEmitLastprivateConditional (CGF, X);
4217
4221
if (Res.first ) {
4218
4222
// 'atomicrmw' instruction was generated.
4219
4223
if (IsPostfixUpdate) {
@@ -4240,13 +4244,15 @@ static void emitOMPAtomicCaptureExpr(CodeGenFunction &CGF, bool IsSeqCst,
4240
4244
auto Res = CGF.EmitOMPAtomicSimpleUpdateExpr (
4241
4245
XLValue, ExprRValue, /* BO=*/ BO_Assign, /* IsXLHSInRHSPart=*/ false , AO,
4242
4246
Loc, Gen);
4247
+ CGF.CGM .getOpenMPRuntime ().checkAndEmitLastprivateConditional (CGF, X);
4243
4248
if (Res.first ) {
4244
4249
// 'atomicrmw' instruction was generated.
4245
4250
NewVVal = IsPostfixUpdate ? Res.second : ExprRValue;
4246
4251
}
4247
4252
}
4248
4253
// Emit post-update store to 'v' of old/new 'x' value.
4249
4254
CGF.emitOMPSimpleStore (VLValue, NewVVal, NewVValType, Loc);
4255
+ CGF.CGM .getOpenMPRuntime ().checkAndEmitLastprivateConditional (CGF, V);
4250
4256
// OpenMP, 2.12.6, atomic Construct
4251
4257
// Any atomic construct with a seq_cst clause forces the atomically
4252
4258
// performed operation to include an implicit flush operation without a
0 commit comments