[clang] [llvm] [OpenMP][clang] 6.0: parsing/sema for message/severity for parallel (PR #146093)
https://github.com/ro-i updated https://github.com/llvm/llvm-project/pull/146093 >From b01bdf107f80f0f023270326e4a16b1dcadd69d8 Mon Sep 17 00:00:00 2001 From: Robert Imschweiler Date: Fri, 27 Jun 2025 10:07:01 -0500 Subject: [PATCH 1/2] [OpenMP][clang] 6.0: parsing/sema for message/severity for parallel Implement parsing and semantic analysis support for the message and severity clauses that have been added to the parallel directive in OpenMP 6.0, 12.1. --- clang/include/clang/AST/OpenMPClause.h| 6 +- clang/lib/Sema/SemaOpenMP.cpp | 4 +- clang/test/OpenMP/parallel_ast_print.cpp | 24 ++--- .../test/OpenMP/parallel_message_messages.cpp | 89 +++ .../OpenMP/parallel_severity_messages.cpp | 70 +++ llvm/include/llvm/Frontend/OpenMP/OMP.td | 2 + 6 files changed, 179 insertions(+), 16 deletions(-) create mode 100644 clang/test/OpenMP/parallel_message_messages.cpp create mode 100644 clang/test/OpenMP/parallel_severity_messages.cpp diff --git a/clang/include/clang/AST/OpenMPClause.h b/clang/include/clang/AST/OpenMPClause.h index c6f99fb21a0f0..8b602f49aefde 100644 --- a/clang/include/clang/AST/OpenMPClause.h +++ b/clang/include/clang/AST/OpenMPClause.h @@ -1775,7 +1775,8 @@ class OMPAtClause final : public OMPClause { } }; -/// This represents 'severity' clause in the '#pragma omp error' directive +/// This represents the 'severity' clause in the '#pragma omp error' and the +/// '#pragma omp parallel' directives. /// /// \code /// #pragma omp error severity(fatal) @@ -1855,7 +1856,8 @@ class OMPSeverityClause final : public OMPClause { } }; -/// This represents 'message' clause in the '#pragma omp error' directive +/// This represents the 'message' clause in the '#pragma omp error' and the +/// '#pragma omp parallel' directives. /// /// \code /// #pragma omp error message("GNU compiler required.") diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index a30acbe9a4bca..4ecc9b0d4c5c8 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -6620,6 +6620,8 @@ StmtResult SemaOpenMP::ActOnOpenMPExecutableDirective( case OMPC_affinity: case OMPC_bind: case OMPC_filter: + case OMPC_severity: + case OMPC_message: continue; case OMPC_allocator: case OMPC_flush: @@ -6637,8 +6639,6 @@ StmtResult SemaOpenMP::ActOnOpenMPExecutableDirective( case OMPC_match: case OMPC_when: case OMPC_at: - case OMPC_severity: - case OMPC_message: default: llvm_unreachable("Unexpected clause"); } diff --git a/clang/test/OpenMP/parallel_ast_print.cpp b/clang/test/OpenMP/parallel_ast_print.cpp index 948baaff30d89..15439ea31215a 100644 --- a/clang/test/OpenMP/parallel_ast_print.cpp +++ b/clang/test/OpenMP/parallel_ast_print.cpp @@ -173,13 +173,13 @@ T tmain(T argc, T *argv) { foo(); #endif #ifdef OMP60 -#pragma omp parallel default(none), private(argc,b) firstprivate(argv) shared (d) if (parallel:argc > 0) num_threads(strict: C) copyin(S::TS, thrp) proc_bind(primary) reduction(+:c, arr1[argc]) reduction(max:e, arr[:C][0:10]) +#pragma omp parallel default(none), private(argc,b) firstprivate(argv) shared (d) if (parallel:argc > 0) num_threads(strict: C) copyin(S::TS, thrp) proc_bind(primary) reduction(+:c, arr1[argc]) reduction(max:e, arr[:C][0:10]) message("msg") severity(fatal) foo(); #endif #pragma omp parallel if (C) num_threads(s) proc_bind(close) reduction(^:e, f, arr[0:C][:argc]) reduction(default, && : g) reduction(task,+:argc) foo(); #ifdef OMP60 -#pragma omp parallel if (C) num_threads(strict: s) proc_bind(close) reduction(^:e, f, arr[0:C][:argc]) reduction(default, && : g) reduction(task,+:argc) +#pragma omp parallel if (C) num_threads(strict: s) proc_bind(close) reduction(^:e, f, arr[0:C][:argc]) reduction(default, && : g) reduction(task,+:argc) message("msg") severity(warning) foo(); #endif return 0; @@ -196,11 +196,11 @@ T tmain(T argc, T *argv) { // CHECK-NEXT: foo() // OMP51-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(C) copyin(S::TS,thrp) proc_bind(primary) reduction(+: c,arr1[argc]) reduction(max: e,arr[:C][0:10]) // OMP51-NEXT: foo() -// OMP60-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(strict: C) copyin(S::TS,thrp) proc_bind(primary) reduction(+: c,arr1[argc]) reduction(max: e,arr[:C][0:10]) +// OMP60-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(strict: C) copyin(S::TS,thrp) proc_bind(primary) reduction(+: c,arr1[argc]) reduction(max: e,arr[:C][0:10]) message("msg") severity(fatal) // OMP60-NEXT: foo() // CHECK-NEXT: #pragma omp parallel if(C) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:C][:argc
[clang] [llvm] [OpenMP][clang] 6.0: parsing/sema for message/severity for parallel (PR #146093)
@@ -960,6 +960,8 @@ def OMP_Parallel : Directive<[Spelling<"parallel">]> { VersionedClause, VersionedClause, VersionedClause, +VersionedClause, +VersionedClause, ro-i wrote: thanks, done https://github.com/llvm/llvm-project/pull/146093 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [OpenMP][clang] 6.0: parsing/sema for message/severity for parallel (PR #146093)
ro-i wrote: Ping. https://github.com/llvm/llvm-project/pull/146093 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [openmp] [OpenMP][clang] 6.0: codegen+runtime for num_threads strict (PR #146346)
@@ -1214,6 +1214,12 @@ void __kmp_serialized_parallel(ident_t *loc, kmp_int32 global_tid) { // Reset for next parallel region this_thr->th.th_set_proc_bind = proc_bind_default; + // OpenMP 6.0 12.1.2 requires the num_threads 'strict' modifier to also have + // effect when parallel execution is disabled by a corresponding if clause + // attached to the parallel directive. + if (this_thr->th.th_nt_strict && this_thr->th.th_set_nproc > 1) ro-i wrote: > This doesn't look right, since this will fail applications still run < 6.0 In that case, `nt_strict` won't be true tho https://github.com/llvm/llvm-project/pull/146346 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [openmp] [OpenMP][clang] 6.0: codegen+runtime for num_threads strict (PR #146346)
ro-i wrote: > Please split the PR into three: front end, device runtime, and libomp for > faster and better review. Ok, will do https://github.com/llvm/llvm-project/pull/146346 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [openmp] [OpenMP][clang] 6.0: codegen+runtime for num_threads strict (PR #146346)
ro-i wrote: Created #146403 #146404 #146405 https://github.com/llvm/llvm-project/pull/146346 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [openmp] [OpenMP][clang] 6.0: codegen+runtime for num_threads strict (PR #146346)
https://github.com/ro-i closed https://github.com/llvm/llvm-project/pull/146346 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [openmp] [OpenMP][clang] 6.0: codegen+runtime for num_threads strict (PR #146346)
@@ -1214,6 +1214,12 @@ void __kmp_serialized_parallel(ident_t *loc, kmp_int32 global_tid) { // Reset for next parallel region this_thr->th.th_set_proc_bind = proc_bind_default; + // OpenMP 6.0 12.1.2 requires the num_threads 'strict' modifier to also have + // effect when parallel execution is disabled by a corresponding if clause + // attached to the parallel directive. + if (this_thr->th.th_nt_strict && this_thr->th.th_set_nproc > 1) ro-i wrote: e.g. by `__kmp_set_strict_num_threads`, which is called by `__kmpc_push_num_threads_strict`, see https://github.com/llvm/llvm-project/pull/85466 https://github.com/llvm/llvm-project/pull/146346 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [OpenMP] Fix comma -> semicolon (PR #145900)
ro-i wrote: > Unresolved Tests (1): > lldb-api :: tools/lldb-dap/runInTerminal/TestDAP_runInTerminal.py Tests being flaky again I guess https://github.com/llvm/llvm-project/pull/145900 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [OpenMP][clang] 6.0: parsing/sema for message/severity for parallel (PR #146093)
https://github.com/ro-i created https://github.com/llvm/llvm-project/pull/146093 Implement parsing and semantic analysis support for the message and severity clauses that have been added to the parallel directive in OpenMP 6.0, 12.1. >From b01bdf107f80f0f023270326e4a16b1dcadd69d8 Mon Sep 17 00:00:00 2001 From: Robert Imschweiler Date: Fri, 27 Jun 2025 10:07:01 -0500 Subject: [PATCH] [OpenMP][clang] 6.0: parsing/sema for message/severity for parallel Implement parsing and semantic analysis support for the message and severity clauses that have been added to the parallel directive in OpenMP 6.0, 12.1. --- clang/include/clang/AST/OpenMPClause.h| 6 +- clang/lib/Sema/SemaOpenMP.cpp | 4 +- clang/test/OpenMP/parallel_ast_print.cpp | 24 ++--- .../test/OpenMP/parallel_message_messages.cpp | 89 +++ .../OpenMP/parallel_severity_messages.cpp | 70 +++ llvm/include/llvm/Frontend/OpenMP/OMP.td | 2 + 6 files changed, 179 insertions(+), 16 deletions(-) create mode 100644 clang/test/OpenMP/parallel_message_messages.cpp create mode 100644 clang/test/OpenMP/parallel_severity_messages.cpp diff --git a/clang/include/clang/AST/OpenMPClause.h b/clang/include/clang/AST/OpenMPClause.h index c6f99fb21a0f0..8b602f49aefde 100644 --- a/clang/include/clang/AST/OpenMPClause.h +++ b/clang/include/clang/AST/OpenMPClause.h @@ -1775,7 +1775,8 @@ class OMPAtClause final : public OMPClause { } }; -/// This represents 'severity' clause in the '#pragma omp error' directive +/// This represents the 'severity' clause in the '#pragma omp error' and the +/// '#pragma omp parallel' directives. /// /// \code /// #pragma omp error severity(fatal) @@ -1855,7 +1856,8 @@ class OMPSeverityClause final : public OMPClause { } }; -/// This represents 'message' clause in the '#pragma omp error' directive +/// This represents the 'message' clause in the '#pragma omp error' and the +/// '#pragma omp parallel' directives. /// /// \code /// #pragma omp error message("GNU compiler required.") diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index a30acbe9a4bca..4ecc9b0d4c5c8 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -6620,6 +6620,8 @@ StmtResult SemaOpenMP::ActOnOpenMPExecutableDirective( case OMPC_affinity: case OMPC_bind: case OMPC_filter: + case OMPC_severity: + case OMPC_message: continue; case OMPC_allocator: case OMPC_flush: @@ -6637,8 +6639,6 @@ StmtResult SemaOpenMP::ActOnOpenMPExecutableDirective( case OMPC_match: case OMPC_when: case OMPC_at: - case OMPC_severity: - case OMPC_message: default: llvm_unreachable("Unexpected clause"); } diff --git a/clang/test/OpenMP/parallel_ast_print.cpp b/clang/test/OpenMP/parallel_ast_print.cpp index 948baaff30d89..15439ea31215a 100644 --- a/clang/test/OpenMP/parallel_ast_print.cpp +++ b/clang/test/OpenMP/parallel_ast_print.cpp @@ -173,13 +173,13 @@ T tmain(T argc, T *argv) { foo(); #endif #ifdef OMP60 -#pragma omp parallel default(none), private(argc,b) firstprivate(argv) shared (d) if (parallel:argc > 0) num_threads(strict: C) copyin(S::TS, thrp) proc_bind(primary) reduction(+:c, arr1[argc]) reduction(max:e, arr[:C][0:10]) +#pragma omp parallel default(none), private(argc,b) firstprivate(argv) shared (d) if (parallel:argc > 0) num_threads(strict: C) copyin(S::TS, thrp) proc_bind(primary) reduction(+:c, arr1[argc]) reduction(max:e, arr[:C][0:10]) message("msg") severity(fatal) foo(); #endif #pragma omp parallel if (C) num_threads(s) proc_bind(close) reduction(^:e, f, arr[0:C][:argc]) reduction(default, && : g) reduction(task,+:argc) foo(); #ifdef OMP60 -#pragma omp parallel if (C) num_threads(strict: s) proc_bind(close) reduction(^:e, f, arr[0:C][:argc]) reduction(default, && : g) reduction(task,+:argc) +#pragma omp parallel if (C) num_threads(strict: s) proc_bind(close) reduction(^:e, f, arr[0:C][:argc]) reduction(default, && : g) reduction(task,+:argc) message("msg") severity(warning) foo(); #endif return 0; @@ -196,11 +196,11 @@ T tmain(T argc, T *argv) { // CHECK-NEXT: foo() // OMP51-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(C) copyin(S::TS,thrp) proc_bind(primary) reduction(+: c,arr1[argc]) reduction(max: e,arr[:C][0:10]) // OMP51-NEXT: foo() -// OMP60-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(strict: C) copyin(S::TS,thrp) proc_bind(primary) reduction(+: c,arr1[argc]) reduction(max: e,arr[:C][0:10]) +// OMP60-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(strict: C) copyin(S::TS,thrp) proc_bind(primary) reduction(+: c,arr1[argc]) reduction(max: e,arr[:C][0:10]) message("
[clang] [OpenMP] Fix comma -> semicolon (PR #145900)
https://github.com/ro-i closed https://github.com/llvm/llvm-project/pull/145900 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [OpenMP][clang] 6.0: parsing/sema for num_threads 'strict' modifier (PR #145490)
https://github.com/ro-i closed https://github.com/llvm/llvm-project/pull/145490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [OpenMP][clang] 6.0: parsing/sema for num_threads 'strict' modifier (PR #145490)
ro-i wrote: merged, thanls for the review! https://github.com/llvm/llvm-project/pull/145490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [OpenMP][clang] declare mapper: fix handling of nested types (PR #143504)
https://github.com/ro-i closed https://github.com/llvm/llvm-project/pull/143504 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [OpenMP][clang] declare mapper: fix handling of nested types (PR #143504)
ro-i wrote: Merged. Thanks for the review :) https://github.com/llvm/llvm-project/pull/143504 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [OpenMP][clang] 6.0: parsing/sema for num_threads 'strict' modifier (PR #145490)
https://github.com/ro-i created https://github.com/llvm/llvm-project/pull/145490 Implement parsing and semantic analysis support for the optional 'strict' modifier of the num_threads clause. This modifier has been introduced in OpenMP 6.0, section 12.1.2. Note: this is basically 1:1 https://reviews.llvm.org/D138328. >From 95f4b7abc6780c8b55ded2c3b09c382ca5270a8f Mon Sep 17 00:00:00 2001 From: Robert Imschweiler Date: Tue, 24 Jun 2025 04:46:29 -0500 Subject: [PATCH] [OpenMP][clang] 6.0: parsing/sema for num_threads 'strict' modifier Implement parsing and semantic analysis support for the optional 'strict' modifier of the num_threads clause. This modifier has been introduced in OpenMP 6.0, section 12.1.2. --- clang/include/clang/AST/OpenMPClause.h| 29 ++- clang/include/clang/Basic/OpenMPKinds.def | 7 ++ clang/include/clang/Basic/OpenMPKinds.h | 6 ++ clang/include/clang/Sema/SemaOpenMP.h | 8 +- clang/lib/AST/OpenMPClause.cpp| 5 ++ clang/lib/Basic/OpenMPKinds.cpp | 21 - clang/lib/Parse/ParseOpenMP.cpp | 33 +++- clang/lib/Sema/SemaOpenMP.cpp | 76 +++ clang/lib/Sema/TreeTransform.h| 11 ++- clang/lib/Serialization/ASTReader.cpp | 2 + clang/lib/Serialization/ASTWriter.cpp | 2 + clang/test/OpenMP/parallel_ast_print.cpp | 42 +- .../OpenMP/parallel_num_threads_messages.cpp | 73 +- llvm/include/llvm/Frontend/OpenMP/OMP.td | 7 ++ 14 files changed, 272 insertions(+), 50 deletions(-) diff --git a/clang/include/clang/AST/OpenMPClause.h b/clang/include/clang/AST/OpenMPClause.h index 05239668b34b1..c6f99fb21a0f0 100644 --- a/clang/include/clang/AST/OpenMPClause.h +++ b/clang/include/clang/AST/OpenMPClause.h @@ -824,31 +824,52 @@ class OMPNumThreadsClause final public OMPClauseWithPreInit { friend class OMPClauseReader; + /// Modifiers for 'num_threads' clause. + OpenMPNumThreadsClauseModifier Modifier = OMPC_NUMTHREADS_unknown; + + /// Location of the modifier. + SourceLocation ModifierLoc; + + /// Sets modifier. + void setModifier(OpenMPNumThreadsClauseModifier M) { Modifier = M; } + + /// Sets modifier location. + void setModifierLoc(SourceLocation Loc) { ModifierLoc = Loc; } + /// Set condition. void setNumThreads(Expr *NThreads) { setStmt(NThreads); } public: /// Build 'num_threads' clause with condition \a NumThreads. /// + /// \param Modifier Clause modifier. /// \param NumThreads Number of threads for the construct. /// \param HelperNumThreads Helper Number of threads for the construct. /// \param CaptureRegion Innermost OpenMP region where expressions in this /// clause must be captured. /// \param StartLoc Starting location of the clause. /// \param LParenLoc Location of '('. + /// \param ModifierLoc Modifier location. /// \param EndLoc Ending location of the clause. - OMPNumThreadsClause(Expr *NumThreads, Stmt *HelperNumThreads, - OpenMPDirectiveKind CaptureRegion, + OMPNumThreadsClause(OpenMPNumThreadsClauseModifier Modifier, Expr *NumThreads, + Stmt *HelperNumThreads, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, - SourceLocation EndLoc) + SourceLocation ModifierLoc, SourceLocation EndLoc) : OMPOneStmtClause(NumThreads, StartLoc, LParenLoc, EndLoc), -OMPClauseWithPreInit(this) { +OMPClauseWithPreInit(this), Modifier(Modifier), +ModifierLoc(ModifierLoc) { setPreInitStmt(HelperNumThreads, CaptureRegion); } /// Build an empty clause. OMPNumThreadsClause() : OMPOneStmtClause(), OMPClauseWithPreInit(this) {} + /// Gets modifier. + OpenMPNumThreadsClauseModifier getModifier() const { return Modifier; } + + /// Gets modifier location. + SourceLocation getModifierLoc() const { return ModifierLoc; } + /// Returns number of threads. Expr *getNumThreads() const { return getStmtAs(); } }; diff --git a/clang/include/clang/Basic/OpenMPKinds.def b/clang/include/clang/Basic/OpenMPKinds.def index 2b1dc1e0121b2..9d6f816eea91f 100644 --- a/clang/include/clang/Basic/OpenMPKinds.def +++ b/clang/include/clang/Basic/OpenMPKinds.def @@ -86,6 +86,9 @@ #ifndef OPENMP_NUMTASKS_MODIFIER #define OPENMP_NUMTASKS_MODIFIER(Name) #endif +#ifndef OPENMP_NUMTHREADS_MODIFIER +#define OPENMP_NUMTHREADS_MODIFIER(Name) +#endif #ifndef OPENMP_DOACROSS_MODIFIER #define OPENMP_DOACROSS_MODIFIER(Name) #endif @@ -227,6 +230,9 @@ OPENMP_GRAINSIZE_MODIFIER(strict) // Modifiers for the 'num_tasks' clause. OPENMP_NUMTASKS_MODIFIER(strict) +// Modifiers for the 'num_tasks' clause. +OPENMP_NUMTHREADS_MODIFIER(strict) + // Modifiers for 'allocate' clause. OPENMP_ALLOCATE_MODIFIER(allocator) OPENMP_ALLOCATE_MODIFIER(align) @@ -238,6 +244,7 @@ OPENMP_DOACROSS_MODIFIER(sink_omp
[clang] [OpenMP] Fix comma -> semicolon (PR #145900)
https://github.com/ro-i created https://github.com/llvm/llvm-project/pull/145900 Fix small typo. >From 935946e76a4a6728acc486f2c419f21256a55cc1 Mon Sep 17 00:00:00 2001 From: Robert Imschweiler Date: Thu, 26 Jun 2025 09:10:38 -0500 Subject: [PATCH] [OpenMP] Fix comma -> semicolon Fix small typo. --- clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp b/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp index 2bc9cd549f01f..e25b6948d30f8 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp +++ b/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp @@ -1257,9 +1257,9 @@ void CGOpenMPRuntimeGPU::emitParallelCall(CodeGenFunction &CGF, if (!NumThreadsVal) NumThreadsVal = llvm::ConstantInt::get(CGF.Int32Ty, -1); else - NumThreadsVal = Bld.CreateZExtOrTrunc(NumThreadsVal, CGF.Int32Ty), + NumThreadsVal = Bld.CreateZExtOrTrunc(NumThreadsVal, CGF.Int32Ty); - assert(IfCondVal && "Expected a value"); +assert(IfCondVal && "Expected a value"); llvm::Value *RTLoc = emitUpdateLocation(CGF, Loc); llvm::Value *Args[] = { RTLoc, ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [OpenMP][clang] declare mapper: fix handling of nested types (PR #143504)
ro-i wrote: As far as I can see the test failures (TypeSanitizer-x86_64) are unrelated to this PR. https://github.com/llvm/llvm-project/pull/143504 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [OpenMP][clang] Fix CaptureRegion for message clause (PR #156525)
https://github.com/ro-i auto_merge_enabled https://github.com/llvm/llvm-project/pull/156525 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [openmp] [offload][OpenMP] Remove device code for num_threads strict (PR #157893)
ro-i wrote: @tbaederr you added some test using num_threads strict (+message/severity) for target in https://github.com/llvm/llvm-project/commit/83ca87715974d386e1ffee8ae8797d8f0f1db205. Can we substitute this by something else? https://github.com/llvm/llvm-project/pull/157893 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [openmp] [offload][OpenMP] Remove device code for num_threads strict (PR #157893)
ro-i wrote: No, there will be no `message` clause in the context of the target directive until I re-implement it. Is it important that it's a target directive? Otherwise, I could just remove the `target` and use the host `parallel` directive. https://github.com/llvm/llvm-project/pull/157893 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [openmp] [offload][OpenMP] Remove device code for num_threads strict (PR #157893)
https://github.com/ro-i closed https://github.com/llvm/llvm-project/pull/157893 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [flang] [llvm] [OpenMP] Introduce the initial support for OpenMP kernel language (PR #66844)
@@ -843,7 +857,8 @@ void CGOpenMPRuntimeGPU::emitTargetOutlinedFunction( assert(!ParentName.empty() && "Invalid target region parent name!"); bool Mode = supportsSPMDExecutionMode(CGM.getContext(), D); - if (Mode) + bool IsBareKernel = D.getSingleClause(); + if (Mode || IsBareKernel) ro-i wrote: @shiltian I accidentally stumbled over this. I think this should be `!IsBareKernel`? https://github.com/llvm/llvm-project/pull/66844 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] Reland: [OpenMP][clang] 6.0: num_threads strict (part 3: codegen) (PR #155839)
https://github.com/ro-i closed https://github.com/llvm/llvm-project/pull/155839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] Reland: [OpenMP][clang] 6.0: num_threads strict (part 3: codegen) (PR #155839)
@@ -1506,8 +1506,10 @@ def err_omp_unexpected_directive : Error< "unexpected OpenMP directive %select{|'#pragma omp %1'}0">; def err_omp_expected_punc : Error< "expected ',' or ')' in '%0' %select{clause|directive}1">; -def warn_clause_expected_string : Warning< +def warn_clause_expected_string_literal : Warning< "expected string literal in 'clause %0' - ignoring">, InGroup; +def warn_clause_expected_string: Warning< + "expected string in 'clause %0' - ignoring">, InGroup; ro-i wrote: done https://github.com/llvm/llvm-project/pull/155839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [openmp] [OpenMP][clang] 6.0: num_threads strict (part 3: codegen) (PR #146405)
https://github.com/ro-i closed https://github.com/llvm/llvm-project/pull/146405 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [openmp] Revert "[OpenMP][clang] 6.0: num_threads strict (part 3: codegen)" (PR #155809)
https://github.com/ro-i closed https://github.com/llvm/llvm-project/pull/155809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [openmp] [OpenMP][clang] 6.0: num_threads strict (part 3: codegen) (PR #146405)
https://github.com/ro-i edited https://github.com/llvm/llvm-project/pull/146405 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [openmp] [OpenMP][clang] 6.0: num_threads strict (part 3: codegen) (PR #146405)
ro-i wrote: (rebased on main after https://github.com/llvm/llvm-project/pull/146404 has been merged) https://github.com/llvm/llvm-project/pull/146405 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [openmp] [OpenMP][clang] 6.0: num_threads strict (part 3: codegen) (PR #146405)
https://github.com/ro-i auto_merge_enabled https://github.com/llvm/llvm-project/pull/146405 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [flang] [llvm] [OpenMP] Introduce the initial support for OpenMP kernel language (PR #66844)
@@ -843,7 +857,8 @@ void CGOpenMPRuntimeGPU::emitTargetOutlinedFunction( assert(!ParentName.empty() && "Invalid target region parent name!"); bool Mode = supportsSPMDExecutionMode(CGM.getContext(), D); - if (Mode) + bool IsBareKernel = D.getSingleClause(); + if (Mode || IsBareKernel) ro-i wrote: Ah I see, thanks for the clarification https://github.com/llvm/llvm-project/pull/66844 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [OpenMP][clang] Set num_threads 'strict' to unsupported on GPUs (PR #160659)
ro-i wrote: That's a good point. I think the argument for the error was that it makes it clearer that this unsupported. A warning might be easy to overlook for larger builds, which might then lead the user believe that everything went as they expected. https://github.com/llvm/llvm-project/pull/160659 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [OpenMP][clang] Set num_threads 'strict' to unsupported on GPUs (PR #160659)
ro-i wrote: (`Transforms/LoopVectorize/AArch64/epilogue-vectorization-fix-scalar-resume-values.ll` is currently broken, unrelated to this PR) https://github.com/llvm/llvm-project/pull/160659 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [openmp] [offload][OpenMP] Remove device code for num_threads strict (PR #157893)
https://github.com/ro-i auto_merge_enabled https://github.com/llvm/llvm-project/pull/157893 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits