[PATCH] D81484: [Clang][OpenMP][OMPBuilder] (4/4) Privatize `parallel` for `OMPBuilder`

Fady Ghanim via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 9 10:58:24 PDT 2020


fghanim marked 6 inline comments as done.
fghanim added inline comments.


================
Comment at: clang/lib/CodeGen/CGStmtOpenMP.cpp:1777
 }
+
+bool CodeGenFunction::OMPBuilderCBHelpers::EmitOMPFirstprivateClause(
----------------
Same as current implementation, with certain changes around the end. changes will be noted below.


================
Comment at: clang/lib/CodeGen/CGStmtOpenMP.cpp:1816
+          !FD->getType()->isReferenceType() &&
+          (!VD || !VD->hasAttr<OMPAllocateDeclAttr>())) {
+        if (CapturedVarsInfoMap[OrigVD].CapturedKind !=
----------------
next line is new


================
Comment at: clang/lib/CodeGen/CGStmtOpenMP.cpp:1901
+                return Emission.getAllocatedAddress();
+              });
+        } else {
----------------
The else part below is almost entirely rewritten


================
Comment at: clang/lib/CodeGen/CGStmtOpenMP.cpp:1982
+
+                CGF.LocalDeclMap.erase(VDInit);
+                if (ThisFirstprivateIsLastprivate &&
----------------
end of new impl.


================
Comment at: clang/lib/CodeGen/CGStmtOpenMP.cpp:2052
+        CV = CGF.EmitLoadOfScalar(DstLV, CurCap->getLocation());
+      }
+      CapturedVarsValueMap[CurCap->getCapturedVar()] = {
----------------
next line is new


================
Comment at: clang/lib/CodeGen/CGStmtOpenMP.cpp:2056
+    } else {
+      assert(CurCap->capturesVariable() && "Expected capture by reference.");
+      CapturedVarsValueMap[CurCap->getCapturedVar()] = {
----------------
next line is new


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81484/new/

https://reviews.llvm.org/D81484





More information about the cfe-commits mailing list