[PATCH] [OPENMP] Codegen for 'private' clause in 'task' directive.

John McCall rjmccall at gmail.com
Wed Apr 29 10:14:40 PDT 2015

A few minor suggestions, but overall LGTM.

Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:1865
@@ +1864,3 @@
+      // Copy values of privates to corresponding references in the list of
+      // captured variables.
+      //   ...
"Copy *addresses* of privates", I think.

Comment at: lib/CodeGen/CGStmtOpenMP.cpp:1391
@@ +1390,3 @@
+    }
+  }
+  CGM.getOpenMPRuntime().emitTaskCall(*this, S.getLocStart(), S, Tied, Final,
You might want to consider sorting this array by alignment, which will give you an optimal packing in the structure you end up building.  On the other hand, it might be better to do that implicitly when building the structure later, then just keep a map from the index in this array to the index there.

Is there a good reason to pass around Privates as an array of Expr* instead of an array of VarDecl*?  It feels like you just end up having to drill down to the declaration constantly.

Also, why not make a single SmallVector of a struct containing both the VarDecl* and the copy expr?



More information about the cfe-commits mailing list