Skip to content

Commit 59047da

Browse files
authored
[clang] Fix incomplete filtering of parallel directives in specialized kernels. (llvm#3836)
1 parent 6b75163 commit 59047da

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8227,11 +8227,24 @@ class NoLoopChecker final : public ConstStmtVisitor<NoLoopChecker> {
82278227

82288228
// Reject if there is a nested OpenMP parallel directive
82298229
void VisitOMPExecutableDirective(const OMPExecutableDirective *D) {
8230-
if (D->getDirectiveKind() == llvm::omp::Directive::OMPD_parallel) {
8230+
switch (D->getDirectiveKind()) {
8231+
case llvm::omp::Directive::OMPD_parallel:
8232+
case llvm::omp::Directive::OMPD_parallel_do:
8233+
case llvm::omp::Directive::OMPD_parallel_do_simd:
8234+
case llvm::omp::Directive::OMPD_parallel_for:
8235+
case llvm::omp::Directive::OMPD_parallel_for_simd:
8236+
case llvm::omp::Directive::OMPD_parallel_master:
8237+
case llvm::omp::Directive::OMPD_parallel_master_taskloop:
8238+
case llvm::omp::Directive::OMPD_parallel_master_taskloop_simd:
8239+
case llvm::omp::Directive::OMPD_parallel_sections:
8240+
case llvm::omp::Directive::OMPD_parallel_workshare: {
82318241
NoLoopCheckStatus = CodeGenModule::NxNestedOmpParallelDirective;
82328242
// No need to continue visiting any more
82338243
return;
82348244
}
8245+
default:
8246+
break;
8247+
}
82358248
for (const Stmt *Child : D->children())
82368249
if (Child)
82378250
Visit(Child);

0 commit comments

Comments
 (0)