Added semantic check support for tile and unroll OpenMP Directive.
OpenMP 5.1
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Update the patch with basic support for semantic checks of
OpenMP Tile and Unroll Constructs
OpenMP 5.1
Ping!
flang/lib/Semantics/check-omp-structure.h | ||
---|---|---|
257 | Are there any more checks needed at this stage? Besides checking integer expression, the length of the list should be equal to the depth of the nested loops | |
flang/test/Semantics/OpenMP/omp-do-tile.f90 | ||
4 | The build is failing on the tests. Is this the right way to write the semantic tests for Flang? | |
llvm/include/llvm/Frontend/OpenMP/OMP.td | ||
72 ↗ | (On Diff #501738) | We need a list of integers to take care of the nested loops !$omp tile sizes(size-list) loop-nest [!$omp end tile] |
flang/test/Semantics/OpenMP/omp-do-tile.f90 | ||
---|---|---|
3 | Nit: it's better to put the !2.11.9.1 tile Cconstruct part on a new line. | |
4 | There are extra spaces in your RUN line. This should work: | |
7–8 | test_errors.py will fail to match the error string here. It must be in a single line. |
Made changes to take semantic checks for OPENMP TILE--> SIZE clause so it
can take list of integers
flang/test/Semantics/OpenMP/omp-do-tile.f90 | ||
---|---|---|
9 | Can you add test with non-constant integer. The standard does precise that
|
flang/test/Semantics/OpenMP/omp-do-tile.f90 | ||
---|---|---|
9 | Do you mean initialing a variable and then using it in the sizes clause: e.g. sizes (2, x, 2)? |
Made changes based on the comments. No it does not check
for both tile and unroll constructs.
Thanks for this patch. Have some request for changes.
flang/lib/Semantics/check-omp-structure.cpp | ||
---|---|---|
659 | Nit: Remove commented code. | |
660 | Nit: Do not use auto, specify the type here. | |
663 | ||
683 | ||
flang/lib/Semantics/check-omp-structure.h | ||
63–73 | Are these changes required? | |
72 | Why is this change required? | |
flang/test/Parser/omp-tile-multisize.f90 | ||
10 | Might be good to specify different sizes for each loop. | |
23–26 | You have to check that the size for all loops. Only one is checked here. | |
flang/test/Semantics/OpenMP/omp-do-tile.f90 | ||
8 | ||
9 | Yeah, an expression like 2 + 2. integer, parameter :: x = -3 !$omp unroll partial(x) ... | |
flang/test/Semantics/OpenMP/omp-do-unroll.f90 | ||
4 |
Made changes in check-omp-structure.cpp as per reviewer's comments. Added two new tests.
flang/test/Semantics/OpenMP/omp-do-tile.f90 | ||
---|---|---|
9 |
yes |
flang/test/Semantics/OpenMP/omp-do-tile.f90 | ||
---|---|---|
9 | Already included for tiles. Will include a test for unrolling as well |
flang/lib/Semantics/check-omp-structure.cpp | ||
---|---|---|
659 | If it is std::nullopt, I do not think it is a semantic error. It will be a bug then. You initiate it when you see something in the clause. It can't be null. This is my understanding. |
flang/lib/Semantics/check-omp-structure.cpp | ||
---|---|---|
659 | So you should use evaluate::ToInt64 directly. |
Why is this change required?