This patch includes parsing and semantic analysis for 'omp distribute' directive for OpenMP 4.5 and regression tests. All clauses present in OpenMP 4.5 for the 'omp distribute' directive are present.
Diff Detail
- Repository
- rL LLVM
Event Timeline
include/clang/AST/OpenMPClause.h | ||
---|---|---|
708 ↗ | (On Diff #41550) | Is it 'schedule'? |
835 ↗ | (On Diff #41550) | 'dist_schedule' |
lib/Parse/ParseOpenMP.cpp | ||
670 | Can we merge it with the OMPC_schedule block? The code is similar. | |
lib/Sema/SemaOpenMP.cpp | ||
5780 | Is the IsNotNegativeIntegerValue useful in this case? | |
tools/libclang/CIndex.cpp | ||
4489 | "OMPDistributeDirective" |
include/clang/AST/OpenMPClause.h | ||
---|---|---|
667 ↗ | (On Diff #41550) | This must be in a separate patch |
708–709 ↗ | (On Diff #41550) | I think this is wrong, this is not for dist_schedule, but for schedule clause |
779 ↗ | (On Diff #41550) | This must be in a separate patch |
include/clang/AST/RecursiveASTVisitor.h | ||
2732–2738 | separate patch | |
include/clang/AST/StmtOpenMP.h | ||
2279 | Distribute directive cannot have inner cancel | |
include/clang/Basic/OpenMPKinds.h | ||
89–95 | Separate patch | |
lib/AST/StmtPrinter.cpp | ||
882 | dist_schedule, not schedule | |
lib/Basic/OpenMPKinds.cpp | ||
475 | distribute is not a worksharing directive | |
lib/Parse/ParseOpenMP.cpp | ||
162 | 'distribute' misses clauses, put your changes right after 'teams' | |
239 | Restore the order of target_data and taskloop directives, put distribute right after taskloop | |
lib/Sema/SemaOpenMP.cpp | ||
1530 | It is not required, closely without no-closely means strictly | |
1989 | Add rules for distribute to all other directives | |
2026–2027 | I don't think this change is required | |
2062–2072 | This must be handled in lines 2173-2181 | |
tools/libclang/CIndex.cpp | ||
4489 | "OMPDistributeDirective" |
Thanks very much for your kind comments and patience at some trivial errors on my side.
This new version of the patch addresses all your concerns and it removes dist_schedule from the patch.
There is only one check in semantic analysis that was non trivial: the description of my solution is addressed in my answer to the related comment.
I will generate a new independent patch for dist_schedule, but in the meantime I look forward to your new comments.
include/clang/AST/OpenMPClause.h | ||
---|---|---|
667 ↗ | (On Diff #41550) | OK - I will create a patch dependent on this one for dist_schedule. |
708 ↗ | (On Diff #41550) | Done |
708–709 ↗ | (On Diff #41550) | Done |
835 ↗ | (On Diff #41550) | Done |
lib/Parse/ParseOpenMP.cpp | ||
162 | Add {clause} after distribute, but I see that distribute is already after teams in this comment. Where else should I move it? | |
670 | Yes, I also believe that this is the right thing to do as schedule type "static" is the same for dist_schedule and schedule. | |
lib/Sema/SemaOpenMP.cpp | ||
1989 | Done and added rules for distribute itself when containing other directives. | |
2026–2027 | I added this to specifically express that distribute needs to be closely nested inside teams, but then reverted to do something different. Following your next comment I made changes that made this necessary again. Please check my answer to your next comment and the associated change in the new patch. | |
2062–2072 | Those lines (2173-2181) check that teams contains the right directives. It means that we look at the parent and we enter the if-then branch only if the parent region is a teams. Anyway, I do agree with you that this should be done elsewhere. I added a new if after the lines you indicated that check the condition above. To report the correct nesting error, however, I needed the ShouldBeInTeamsRegion value above. Please check the new version of the patch and the regression test for this. | |
5780 | I think this is related to templates and we are not checking the value of ChunkSize until later (lines 5795-5796). I did not find a IsNotNegativeIntegerValue for the type llvm::APSInt but maybe I should look elsewhere? | |
tools/libclang/CIndex.cpp | ||
4489 | Done | |
4489 | Done |
include/clang-c/Index.h | ||
---|---|---|
2263–2267 | Update it to the latest changes | |
include/clang/AST/OpenMPClause.h | ||
708–709 ↗ | (On Diff #41712) | Revert back these changes, this comment should not be modified |
include/clang/AST/StmtOpenMP.h | ||
2282 | You forget to modify OMPLoopDirective::classof() | |
lib/Basic/OpenMPKinds.cpp | ||
460 | Revert these changes back | |
lib/Parse/ParseOpenMP.cpp | ||
162 | Remove {clause} after 'teams' | |
402 | Revert back these changes | |
684 | Revert back these changes |
This updated patch includes taskloop simd changes form the trunk and it addresses the second round of comments.
lib/Basic/OpenMPKinds.cpp | ||
---|---|---|
460 | This changed due to taskloop. I have added distribute after taskloop and placed the comment in the same way as is in the current trunk for taskloop. |
separate patch