[PATCH] D52731: [OpenMP] Simplify code for reductions on distribute directives, NFC.

Jonas Hahnfeld via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 2 12:14:38 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rC343617: [OpenMP] Simplify code for reductions on distribute directives, NFC. (authored by Hahnfeld, committed by ).

Repository:
  rC Clang

https://reviews.llvm.org/D52731

Files:
  lib/CodeGen/CGStmtOpenMP.cpp


Index: lib/CodeGen/CGStmtOpenMP.cpp
===================================================================
--- lib/CodeGen/CGStmtOpenMP.cpp
+++ lib/CodeGen/CGStmtOpenMP.cpp
@@ -3400,20 +3400,7 @@
       if (isOpenMPSimdDirective(S.getDirectiveKind()) &&
           !isOpenMPParallelDirective(S.getDirectiveKind()) &&
           !isOpenMPTeamsDirective(S.getDirectiveKind())) {
-        OpenMPDirectiveKind ReductionKind = OMPD_unknown;
-        if (isOpenMPParallelDirective(S.getDirectiveKind()) &&
-            isOpenMPSimdDirective(S.getDirectiveKind())) {
-          ReductionKind = OMPD_parallel_for_simd;
-        } else if (isOpenMPParallelDirective(S.getDirectiveKind())) {
-          ReductionKind = OMPD_parallel_for;
-        } else if (isOpenMPSimdDirective(S.getDirectiveKind())) {
-          ReductionKind = OMPD_simd;
-        } else if (!isOpenMPTeamsDirective(S.getDirectiveKind()) &&
-                   S.hasClausesOfKind<OMPReductionClause>()) {
-          llvm_unreachable(
-              "No reduction clauses is allowed in distribute directive.");
-        }
-        EmitOMPReductionClauseFinal(S, ReductionKind);
+        EmitOMPReductionClauseFinal(S, OMPD_simd);
         // Emit post-update of the reduction variables if IsLastIter != 0.
         emitPostUpdateForReductionClause(
             *this, S, [IL, &S](CodeGenFunction &CGF) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52731.167997.patch
Type: text/x-patch
Size: 1362 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181002/e7487082/attachment.bin>


More information about the cfe-commits mailing list