[Mlir-commits] [mlir] [MLIR][SCF] Add an API to fuse consumer to a producer within scf loop (PR #88712)

Abhishek Varma llvmlistbot at llvm.org
Thu Apr 18 05:04:28 PDT 2024


================
@@ -30,6 +30,24 @@ namespace tensor {
 FailureOr<TilingResult> replaceExtractSliceWithTiledProducer(
     OpBuilder &builder, tensor::ExtractSliceOp sliceOp, OpResult producerOp);
 
+/// Pattern to swap an `tensor.insert_slice` with its consumer when the
+/// consumer implements the `TilingInterface`. The pattern itself does not
+/// provide a mechanism to control where the application happens. With use of
+/// transform dialect that control is done within the transform dialect. Other
+/// use cases can inherit from this pattern and add necessary controls.
+FailureOr<TilingResult> replaceInsertSliceWithTiledConsumer(
+    OpBuilder &builder, tensor::InsertSliceOp sliceOp, OpOperand &consumerOp);
+
+/// Pattern to swap an `tensor.insert_slice` with its consumer when the
+/// consumer implements the `TilingInterface`. The pattern itself does not
+/// provide a mechanism to control where the application happens. With use of
+/// transform dialect that control is done within the transform dialect. Other
+/// use cases can inherit from this pattern and add necessary controls.
+FailureOr<TilingResult>
+replaceInsertSliceWithTiledConsumer(OpBuilder &builder,
----------------
Abhishek-Varma wrote:

So, I have done this using [OffsetSizeAndStrideOpInterface](https://github.com/llvm/llvm-project/blob/f2da6702a0967fbd667fff6fa94ac4ba681a0cc2/mlir/include/mlir/Dialect/Tensor/Transforms/Transforms.h#L41). Thanks for the nudge!

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


More information about the Mlir-commits mailing list