Following this post (Follow-up: progress on OpenMP Loop Transformations support for Flang), some work has been done on adding canonical loop operations to the OpenMP dialect of MLIR but I haven’t seen any support for a canonical loop structure in the Flang’s frontend in the main branch of the LLVM project.
My team is interested in the implementation of OpenMP loop transformations in Flang and wanted to ask if there is ongoing or planned work on the topic (parser, semantic, lowering to MLIR, etc). Maybe someone knows if an implementation exists, for example, in a different branch and can point us to it.
If there is no active development being done we would like to start it.
@Meinersbur @jansjodi @skatrak Could you comment if any work is happening in this area?
We are currently working on a simplified implementation for tiling. I have been doing some preliminary work in GitHub - jsjodin/llvm-project at jleyonberg/tiling. This is work in progress and is not functional yet. It does not use the new ops and instead modifies the existing LoopNestOp to handle both collapse and tile. This approach is not based on the final more flexible representation, but it allows us to have tiling support sooner.
As Kiran pointed out in the previous post [OpenMP][MLIR] Add omp.canonical_loop operation, !omp.cli type, omp.new_cli operation by jsjodin · Pull Request #71712 · llvm/llvm-project · GitHub is the PR that adds the canonical loop op and the canonical loop info, which is the solution that was agreed on. I can update this PR so that it can be approved and merged soon. After that we are planning to add some loop transformation operations as well (or a single transformation op with an operand/attribute that specifies the transformation) and to work on the lowering from MLIR to LLVM-IR. We have not done much work (other than what is in the tiling branch above) on the frontend, so anyone that wants to contribute to this is welcome. Michel Kruse (@Meinersbur) is unfortunately out this week but should be back next week to give his thoughts on this. Hopefully, we can keep the LoopNestOp and the current functionality in place while developing the canonical loops and transforms, so that we can incrementally work on the new implementation. We can set up a meeting next week or so to discuss the implementation work and how to proceed.
2 Likes
@jansjodi Thanks for the update! A meeting to align ourselves with you and Michael on the implementation of canonical loops and transforms would be very helpful. We have a flexible schedule (inside the European timezone) and we are at your disposal.
@ftodacas Love to hear for the interest. I was and am still working on the omp.canonical_loop modeling, but got consumed with other work. Last think that was time-consuming is the Flang parsing part.
Happy to discuss common work. I created a when2meet to select a meeting time: omp.canonical_loop - When2meet
1 Like
I’m going to be a few minutes late to this, can we push it 15-30 minutes later?
I have a meeting at 16:00 CEST, so that would shorten the meeting. I suggest you join as soon as I can while I introduce ftodacas to the ideas