[PATCH] [OPENMP] Codegen for 'private' clause in 'parallel' directive

hfinkel at anl.gov hfinkel at anl.gov
Mon Sep 22 01:51:31 PDT 2014


Please separate out the Sema changes into a separate patch.

================
Comment at: lib/CodeGen/CGStmtOpenMP.cpp:52
@@ +51,3 @@
+  if (!OuterDeclMap.empty()) {
+    // Emit implicit barrier to synchronize threads and avoid data races.
+    // Build call __kmpc_barrier(loc, gtid)
----------------
The note in the patch summary, that this is to ensure all threads initialize using the original values of the variables, is more informative than this comment.

================
Comment at: lib/Serialization/ASTWriterStmt.cpp:1755
@@ -1754,2 +1754,3 @@
   Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
-  for (auto *VE : C->varlists())
+  for (auto *VE : C->varlists()) {
+    Writer->Writer.AddStmt(VE);
----------------
Don't need {}

================
Comment at: lib/Serialization/ASTWriterStmt.cpp:1758
@@ -1756,1 +1757,3 @@
+  }
+  for (auto *VE : C->private_copies()) {
     Writer->Writer.AddStmt(VE);
----------------
Don't need {}

http://reviews.llvm.org/D4752






More information about the cfe-commits mailing list