This patch implements code generation for the teams directive. It only provides support for num_teams and thread_limit clauses, while all other clauses will come with later patches.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/CodeGen/CGOpenMPRuntime.cpp | ||
---|---|---|
4415–4435 | I don't like the idea of processing num_teams and thread_limit clauses in runtime lib. This must be done in emitCommonOMPTeamsDirective(), not in runtime | |
4450–4461 | This is very similar to emitParallelOutlinedFunction(). Maybe it is a good idea to join them into a single one? |
Apply changes to reflect review: have a single emit outlined function call for both parallel and teams; call push_num_teams outside of runtime class.
I updated the patch to reflect the comments. I will wait for an answer to the comment asking to split the emit function for push_num_teams. Thanks!
lib/CodeGen/CGOpenMPRuntime.h | ||
---|---|---|
997–1003 | I do not understand this: thread_limit and num_teams can only be input to the library function kmpc_push_num_teams, which accepts values corresponding to those two parameters. |
lib/CodeGen/CGOpenMPRuntime.cpp | ||
---|---|---|
4426–4431 | What is this? Copy-paste? | |
4432–4433 | This must be checked at the start of the function | |
lib/CodeGen/CGOpenMPRuntime.h | ||
997–1003 | Ok, just missed it. | |
lib/CodeGen/CGStmtOpenMP.cpp | ||
2724–2725 | These vars must be declared inside 'if' stmt for clauses. | |
2758 | I don't think we need this comment now. |
lib/CodeGen/CGOpenMPRuntime.cpp | ||
---|---|---|
4426–4431 | Yes, it is - sorry! |
This must be split in 2 functions: emitNumTeamsClause() and emitThreadLimitClause().