[Mlir-commits] [mlir] [mlir][TilingInterface] Use `LoopLikeOpInterface` in tiling using SCF to unify tiling with `scf.for` and `scf.forall`. (PR #77874)

Mehdi Amini llvmlistbot at llvm.org
Wed Jan 17 23:53:33 PST 2024


================
@@ -218,6 +221,53 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
         return ::mlir::failure();
       }]
     >,
+    InterfaceMethod<[{
+        Append the specified additional "init" operands: replace this loop with
+        a new loop that has the additional init operands. The loop body of
+        this loop is moved over to the new loop.
+
+        This method is similar to `replaceWithAdditionalYields` but instead of
+        returning the value that is actually yielded, this returns the tiles of
+        the values that are yielded. This allows for unified handling of opreations
+        like `scf.forall` which dont yield a value from the loop, but instead
+        the terminator specifies where to insert the tile yielded by the body of
+        the loop. For example,
+        
+        ```mlir
+        %0 = scf.forall ... shared_outs(%arg0 = %arg1) {
+          ...
+          %tiled_value
----------------
joker-eph wrote:

```suggestion
          %tiled_value = ...
```

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


More information about the Mlir-commits mailing list