[all-commits] [llvm/llvm-project] c873e5: [mlir][TilingInterface] Handle multi operand consu...

MaheshRavishankar via All-commits all-commits at lists.llvm.org
Wed Jun 25 11:54:59 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c873e5f87d84bab700a297af8cdb76b2bd3ece88
      https://github.com/llvm/llvm-project/commit/c873e5f87d84bab700a297af8cdb76b2bd3ece88
  Author: MaheshRavishankar <1663364+MaheshRavishankar at users.noreply.github.com>
  Date:   2025-06-25 (Wed, 25 Jun 2025)

  Changed paths:
    M mlir/include/mlir/Dialect/SCF/Transforms/TileUsingInterface.h
    M mlir/include/mlir/Dialect/Tensor/Transforms/Transforms.h
    M mlir/include/mlir/IR/OpDefinition.h
    M mlir/include/mlir/Interfaces/TilingInterface.td
    M mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp
    M mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
    M mlir/lib/Dialect/Tensor/Transforms/SwapExtractSliceWithProducerPatterns.cpp
    M mlir/test/Dialect/Linalg/transform-op-fuse-into-containing.mlir
    M mlir/test/Interfaces/TilingInterface/tile-and-fuse-consumer.mlir
    M mlir/test/lib/Interfaces/TilingInterface/TestTilingInterfaceTransformOps.cpp
    M mlir/test/lib/Interfaces/TilingInterface/TestTilingInterfaceTransformOps.td

  Log Message:
  -----------
  [mlir][TilingInterface] Handle multi operand consumer fusion. (#145193)

For consumer fusion cases of this form

```
%0:2 = scf.forall .. shared_outs(%arg0 = ..., %arg0 = ...) {

  tensor.parallel_insert_slice ... into %arg0
  tensor.parallel_insert_slice ... into %arg1
}
%1 = linalg.generic ... ins(%0#0, %0#1)
```

the current consumer fusion that handles one slice at a time cannot fuse
the consumer into the loop, since fusing along one slice will create and
SSA violation on the other use from the `scf.forall`. The solution is to
allow consumer fusion to allow considering multiple slices at once. This
PR changes the `TilingInterface` methods related to consumer fusion,
i.e.

- `getTiledImplementationFromOperandTile`
- `getIterationDomainFromOperandTile`

to allow fusion while considering multiple operands. It is upto the
`TilingInterface` implementation to return an error if a list of tiles
of the operands cannot result in a consistent implementation of the
tiled operation.

The Linalg operation implementation of `TilingInterface` has been
modified to account for these changes and allow cases where operand
tiles that can result in a consistent tiling implementation are handled.

---------

Signed-off-by: MaheshRavishankar <mahesh.ravishankar at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list