[PATCH] [OPENMP] Codegen for 'reduction' clause in 'parallel' directive.

Alexey Bataev a.bataev at hotmail.com
Fri Apr 10 02:59:41 PDT 2015


John, thank you very much for the review!


================
Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:1626
@@ +1625,3 @@
+  //  *(Type<n>-1*)lhs[<n>-1] = ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1],
+  //  *(Type<n>-1*)rhs[<n>-1]);
+  CodeGenFunction::OMPPrivateScope Scope(CGF);
----------------
rjmccall wrote:
> Writing the second line actually makes this less clear.  I would just write one line in terms of "i", like
>   *(Type<i>*)lhs[i] = ...
Ok, will be fixed.

================
Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:1782
@@ +1781,3 @@
+    };
+    CGF.EHStack.pushCleanup<CallEndCleanup>(
+        NormalAndEHCleanup, [this, WithNowait, EndArgs](CodeGenFunction &CGF) {
----------------
rjmccall wrote:
> Pushing the cleanup immediately before the scope is left like this doesn't do anything except emit it immediately on the normal path.  Did you mean to push it before doing any of the reduction operations?
Thanks, I'll fix this.

http://reviews.llvm.org/D8915

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list