From b4505a722927a16fbb5dcbec5e3b90ab1d7942dd Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 30 Mar 2015 05:20:59 +0000 Subject: [OPENMP] Codegen for 'atomic update' construct. Adds atomic update codegen for the following forms of expressions: x binop= expr; x++; ++x; x--; --x; x = x binop expr; x = expr binop x; If x and expr are integer and binop is associative or x is a LHS in a RHS of the assignment expression, and atomics are allowed for type of x on the target platform atomicrmw instruction is emitted. Otherwise compare-and-swap sequence is emitted: bb: ... atomic load cont: = phi [ , label %bb ], [ , %cont ] = binop = cmpxchg atomic &, desired, expected = .field1; br field2, label %exit, label %cont exit: ... Differential Revision: http://reviews.llvm.org/D8536 llvm-svn: 233513 --- clang/lib/Serialization/ASTWriterStmt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/Serialization/ASTWriterStmt.cpp') diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp index 6e647c31950..daebc52c96b 100644 --- a/clang/lib/Serialization/ASTWriterStmt.cpp +++ b/clang/lib/Serialization/ASTWriterStmt.cpp @@ -2005,11 +2005,11 @@ void ASTStmtWriter::VisitOMPAtomicDirective(OMPAtomicDirective *D) { VisitStmt(D); Record.push_back(D->getNumClauses()); VisitOMPExecutableDirective(D); - Record.push_back(D->getOpKind()); Writer.AddStmt(D->getX()); - Writer.AddStmt(D->getXRVal()); Writer.AddStmt(D->getV()); Writer.AddStmt(D->getExpr()); + Writer.AddStmt(D->getUpdateExpr()); + Record.push_back(D->isXLHSInRHSPart() ? 1 : 0); Code = serialization::STMT_OMP_ATOMIC_DIRECTIVE; } -- cgit v1.2.3