[Mlir-commits] [llvm] [mlir] [MLIR][OpenMP] add interchange operation in the OpenMP mlir dialect (PR #186381)

Michael Kruse llvmlistbot at llvm.org
Fri Mar 27 05:03:30 PDT 2026


================
@@ -1434,6 +1434,20 @@ class OpenMPIRBuilder {
   /// \param Loop The loop to unroll. The loop will be invalidated.
   LLVM_ABI void unrollLoopFull(DebugLoc DL, CanonicalLoopInfo *Loop);
 
+  /// Interchange the order of the nested loops.
+  ///
+  /// @param DL          Debug location for instructions added by interchange.
+  /// @param Loops       Loops affected by loop interchange. The
+  ///                    CanonicalLoopInfo objects are invalidated by this
+  ///                    method, i.e. should not be used after interchange.
+  /// @param Permutation The new order in wich the \p Loops will be arranged.
+  ///
+  /// \returns A list of generated loops. Contains the same loops as the input
+  ///          loop nest reordered.
+  LLVM_ABI std::vector<CanonicalLoopInfo *>
+  interchangeLoops(DebugLoc DL, ArrayRef<CanonicalLoopInfo *> Loops,
+                   std::vector<int> Permutation);
----------------
Meinersbur wrote:

```suggestion
                   ArrayRef<int> Permutation);
```
https://llvm.org/docs/ProgrammersManual.html#llvm-adt-arrayref-h

https://github.com/llvm/llvm-project/pull/186381


More information about the Mlir-commits mailing list