This patch generates call to "kmpc_push_num_threads(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_threads);" library function before calling "kmpc_fork_call" each time there is an associated "num_threads" clause in the "omp parallel" directive.
Details
Diff Detail
Event Timeline
include/clang/AST/StmtOpenMP.h | ||
---|---|---|
131 | Make it "Gets a single" or "Gets the single" | |
132 | Also, make it clear that this asserts if there is more than one clause of the specified kind. | |
lib/AST/Stmt.cpp | ||
1396 | "is at least" -> "are at least" | |
lib/Sema/SemaOpenMP.cpp | ||
2592 | Do you need all of these checks, or is value-dependent enough? | |
2613 | While it is true that omp_get/set_num_threads uses 'int' to represent the number of threads, I think this cast (trunc/ext) to int32_t should be done in CodeGen, not here (it is runtime specific -- the AST should retain the original type). | |
test/OpenMP/parallel_num_threads_codegen.cpp | ||
5 | Don't need include-guards here. |
test/OpenMP/parallel_num_threads_codegen.cpp | ||
---|---|---|
5 | n/m -- as you pointed out in the other review, these are needed because of the PCH testing. |
lib/Sema/SemaOpenMP.cpp | ||
---|---|---|
2592 | I'm not sure; I think this is worth testing. A similar issue same up with the patches for the assume_aligned attribute, and it turned out that only the ValueDependent check was needed. Note that sizeof(T), for example, is value-dependent, not type-dependent. |
lib/Sema/SemaOpenMP.cpp | ||
---|---|---|
2592 | Here are some excerpts from the header: |
lib/Sema/SemaOpenMP.cpp | ||
---|---|---|
2592 | Ah, you're right. num_threads is not necessarily a compile-time constant, so the situation is different. |
Make it "Gets a single" or "Gets the single"