summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorJonas Hahnfeld <hahnjo@hahnjo.de>2018-10-02 19:12:47 +0000
committerJonas Hahnfeld <hahnjo@hahnjo.de>2018-10-02 19:12:47 +0000
commit5aaaecea7c9dfc0078465e55dafcfa9e619e8eee (patch)
tree220193b2f0da309165c4108f5277b5ee0d42adb0 /clang
parent4b1ec17fb030c065697993206aac3f9055348590 (diff)
downloadbcm5719-llvm-5aaaecea7c9dfc0078465e55dafcfa9e619e8eee.tar.gz
bcm5719-llvm-5aaaecea7c9dfc0078465e55dafcfa9e619e8eee.zip
[OpenMP] Simplify code for reductions on distribute directives, NFC.
Only need to care about the 'distribute simd' case, all other composite directives are handled elsewhere. This was already reflected in the outer 'if' condition, so all other inner conditions could never be true. Differential Revision: https://reviews.llvm.org/D52731 llvm-svn: 343617
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/CGStmtOpenMP.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp
index 1efbccaa710..1f64e887bfe 100644
--- a/clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -3400,20 +3400,7 @@ void CodeGenFunction::EmitOMPDistributeLoop(const OMPLoopDirective &S,
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) {
OpenPOWER on IntegriCloud