Adapt LoopSwapTrans to allow more complex loop reordering #2715
LonelyCat124
started this conversation in
Ideas
Replies: 1 comment
-
We have |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
After Mark's talk today, I think we have no inbuilt transformation to enable loop reordering other than for the basic case of
LoopSwapTrans
.So for example if we had a case where we have 5 nested loops and wanted to move the inner-most loop up two levels we'd have to essentially call LoopSwapTrans twice on its parent , which would be a bit complicated to generalise for a code-base (e.g. if we wanted to automatically move the k loop in LFRic to be the innermost collapsable loop whenever possible for GPUs).
We'd probably also want some sort of correctness checking if the reordered loop is safe for some level of parallelism, but I couldn't construct a failing example right now.
I'm not sure how easy this would be (and thus whether its worthwhile over Fortran code refactoring) but it would depend on if its likely to be useful in the original source codes.
Beta Was this translation helpful? Give feedback.
All reactions