Adding IMplementation of private, firstprivate, copyin clauses to
the OMPBuilder implementation of omp parallel in clang
Details
- Reviewers
jdoerfert kiranchandramohan
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Generally you copied the existing Clang logic, correct?
clang/lib/CodeGen/CGStmtOpenMP.cpp | ||
---|---|---|
796–797 | Wasn't this part of D79675? (btw I tried to comprehend why this is needed and it is on my list for things we replace eventually). | |
885 | Please undo as it doesn't seem to change anything. | |
3449 | These 4 lines can go in on their own, LGTM on them. |
Well, Yes and no. I tried to keep as much as I can of the original implementation, however, some required more extensive changes.
The things added to emitparalleldirective are all new
Almost the latter half of the OMPBuilder version of emitfirstprivateclause
somethings in the the OMPBuilder version of emitcopyinclause
The rest had minor or smaller changes, but generally the same
the lit tests had some changes
clang/lib/CodeGen/CGStmtOpenMP.cpp | ||
---|---|---|
796–797 | ignore - I originally wanted to use the original emitfirstprivate, before I had to make some changes. This is remaining from that code. The same comment / todo is in OMPBuilder specific version below. I also, removed this from D79676 |
@jdoerfert Please suggest reviewer's for this, and I will add them to other clang related patches
Thanks @fghanim for this patch. I will get to this on Friday if you can add me as a reviewer.
Is the ordering of code generation for clauses important?
copyin -> firstprivate -> barrier -> private
clang/lib/CodeGen/CGStmtOpenMP.cpp | ||
---|---|---|
1673 | Should this change in this patch? | |
1729–1736 | Nit: What do these three cases correspond to? A comment might be useful. | |
1743 | Not a comment about this patch: While the context makes it clear, the name does not suggest that this function is emitting something. |
if we emitted a copyin, then prob. yes. otherwise no.
clang/lib/CodeGen/CGStmtOpenMP.cpp | ||
---|---|---|
1673 | No, still used for shared variables. but the todo should go away. | |
1729–1736 | Just checks to see what to do with the terminator of the entry block. I'll add a comment in an update | |
1743 | you mean ForceClean()? |
To commit it ... eventually :)
Once it (and the rest in the series) get reviewed. As it stands, I cannot commit this patch without the rest in the series, and I cannot find reviewers for the other patches.
I am not sure what to test here that isn't tested elsewhere in the series. This patch is the last in a series, and it represents the "usage" of the functionality added by the other patches. Each of the other patches has its test as a part of it.
clang-format not found in user's PATH; not linting file.