forked from OSchip/llvm-project
[OPENMP50]Fix handling of clauses in parallel master taskloop directive.
We need to capture correctly the value of num_tasks clause and should not try to emit the if clause at all in the task region.
This commit is contained in:
parent
715783d415
commit
18789bfe3a
|
@ -2018,12 +2018,14 @@ static void emitCommonSimdLoop(CodeGenFunction &CGF, const OMPLoopDirective &S,
|
|||
BodyCodeGen(CGF);
|
||||
};
|
||||
const Expr *IfCond = nullptr;
|
||||
for (const auto *C : S.getClausesOfKind<OMPIfClause>()) {
|
||||
if (CGF.getLangOpts().OpenMP >= 50 &&
|
||||
(C->getNameModifier() == OMPD_unknown ||
|
||||
C->getNameModifier() == OMPD_simd)) {
|
||||
IfCond = C->getCondition();
|
||||
break;
|
||||
if (isOpenMPSimdDirective(S.getDirectiveKind())) {
|
||||
for (const auto *C : S.getClausesOfKind<OMPIfClause>()) {
|
||||
if (CGF.getLangOpts().OpenMP >= 50 &&
|
||||
(C->getNameModifier() == OMPD_unknown ||
|
||||
C->getNameModifier() == OMPD_simd)) {
|
||||
IfCond = C->getCondition();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (IfCond) {
|
||||
|
@ -5682,7 +5684,7 @@ void CodeGenFunction::EmitOMPParallelMasterTaskLoopDirective(
|
|||
Action.Enter(CGF);
|
||||
CGF.EmitOMPTaskLoopBasedDirective(S);
|
||||
};
|
||||
OMPLexicalScope Scope(CGF, S, llvm::None, /*EmitPreInitStmt=*/false);
|
||||
OMPLexicalScope Scope(CGF, S, OMPD_parallel, /*EmitPreInitStmt=*/false);
|
||||
CGM.getOpenMPRuntime().emitMasterRegion(CGF, TaskLoopCodeGen,
|
||||
S.getBeginLoc());
|
||||
};
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -x c++ -emit-llvm %s -o - -femit-all-decls | FileCheck %s
|
||||
// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
|
||||
// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls | FileCheck %s
|
||||
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fopenmp-version=50 -x c++ -emit-llvm %s -o - | FileCheck %s
|
||||
// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
|
||||
// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
|
||||
|
||||
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -x c++ -emit-llvm %s -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
|
||||
// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
|
||||
// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
|
||||
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -fopenmp-version=50 -x c++ -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
|
||||
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
|
||||
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
|
||||
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
|
||||
// expected-no-diagnostics
|
||||
#ifndef HEADER
|
||||
|
|
Loading…
Reference in New Issue