[PATCH] D17148: [OPENMP] Basic teams directive implementation
Alexey Bataev via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 18 05:28:30 PST 2016
ABataev added inline comments.
================
Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:4426-4431
@@ +4425,8 @@
+ SourceLocation Loc) {
+ llvm::Value *PushNumTeamsArgs[] = {
+ emitUpdateLocation(CGF, Loc), getThreadID(CGF, Loc), NumTeams,
+ ThreadLimit};
+ CGF.EmitRuntimeCall(createRuntimeFunction(OMPRTL__kmpc_push_num_teams),
+ PushNumTeamsArgs);
+
+ if (!CGF.HaveInsertPoint())
----------------
What is this? Copy-paste?
================
Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:4432-4433
@@ +4431,4 @@
+
+ if (!CGF.HaveInsertPoint())
+ return;
+ // Build call __kmpc_push_num_threads(&loc, global_tid, num_threads)
----------------
This must be checked at the start of the function
================
Comment at: lib/CodeGen/CGOpenMPRuntime.h:997-1003
@@ +996,9 @@
+
+ /// \brief Emits call to void __kmpc_push_num_teamss(ident_t *loc, kmp_int32
+ /// global_tid, kmp_int32 num_teams, kmp_int32 thread_limit) to generate code
+ /// for num_teams clause.
+ /// \param NumTeams An integer value of teams.
+ /// \param ThreadsLimit An integer value of threads.
+ virtual void emitNumTeamsClause(CodeGenFunction &CGF, llvm::Value *NumTeams,
+ llvm::Value *ThreadLimit, SourceLocation Loc);
+
----------------
Ok, just missed it.
================
Comment at: lib/CodeGen/CGStmtOpenMP.cpp:2724-2725
@@ +2723,4 @@
+ const OMPTeamsDirective &TD = *dyn_cast<OMPTeamsDirective>(&S);
+ llvm::Value *NumTeamsVal = nullptr;
+ llvm::Value *ThreadLimitVal = nullptr;
+
----------------
These vars must be declared inside 'if' stmt for clauses.
================
Comment at: lib/CodeGen/CGStmtOpenMP.cpp:2758
@@ -2712,1 +2757,3 @@
+
+ // TODO: deal with clauses other than num_teams and thread_limit
----------------
I don't think we need this comment now.
Repository:
rL LLVM
http://reviews.llvm.org/D17148
More information about the cfe-commits
mailing list