This patch adds a new code generation path for bound sharing directives containing distribute parallel for. The new code generation scheme applies to chunked schedules on distribute and parallel for directives. The scheme simplifies the code that is being generated by eliminating the need for an outer for loop over chunks for both distribute and parallel for directives. In the case of distribute it applies to any sized chunk while in the parallel for case it only applies when chunk size is 1.
Details
Details
- Reviewers
ABataev caomhin - Commits
- rGe92567601b4b: [OpenMP][NVPTX] Use single loops when generating code for distribute parallel…
rC345509: [OpenMP][NVPTX] Use single loops when generating code for distribute parallel…
rL345509: [OpenMP][NVPTX] Use single loops when generating code for distribute parallel…
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/CodeGen/CGOpenMPRuntime.h | ||
---|---|---|
904 ↗ | (On Diff #170241) | I'd rename this into isDistStaticChunked |
lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp | ||
4249 ↗ | (On Diff #170241) | If the ChunkOne field is not required, you need to restore original code here |
lib/CodeGen/CGStmtOpenMP.cpp | ||
2360 ↗ | (On Diff #170241) | This whole code is very similar to the unchunked case. Could you merge it? |
2362 ↗ | (On Diff #170241) | It allows you to check only the implicit case, what about if the user explicitly specifies that chunk is 1? |
3421 ↗ | (On Diff #170241) | Again, very similar to the unchunked code. Merge it. |
lib/Sema/SemaOpenMP.cpp | ||
5207 ↗ | (On Diff #170241) | Seems to me, you need to use NumIterations instead of LastIteration |
lib/CodeGen/CGOpenMPRuntime.h | ||
---|---|---|
904 ↗ | (On Diff #170241) | I've used the same naming convention as the isStaticNonchunked function for consistency. |
Comment Actions
What about collapsed loops?
lib/CodeGen/CGStmtOpenMP.cpp | ||
---|---|---|
3390 ↗ | (On Diff #171116) | Restore the original code here, the logic can be simplified |
3396 ↗ | (On Diff #171116) | The same |
3434–3454 ↗ | (On Diff #171116) | Please, simplify this |