[Mlir-commits] [mlir] [MLIR] Add fusability query to TilingInterface (PR #166502)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Dec 4 17:49:22 PST 2025


================
@@ -359,6 +359,52 @@ struct LinalgOpTilingInterface
     /// Inline the op payload and store the result.
     return inlinePayload(builder, linalgOp, ivs, indexedValues);
   }
+
+  bool isOpFusableWithConsumerSlice(Operation *op, unsigned resultNumber,
+                                    ArrayRef<OpFoldResult> offsets,
+                                    ArrayRef<OpFoldResult> sizes) const {
+    return !cast<LinalgOp>(op).getShapesToLoopsMap();
+  }
+
+  bool isOpFusableWithProducerSlices(
+      Operation *op, ArrayRef<unsigned> operandNumbers,
+      ArrayRef<SmallVector<OpFoldResult>> allOffsets,
+      ArrayRef<SmallVector<OpFoldResult>> allSizes) const {
+
+    auto linalgOp = cast<LinalgOp>(op);
----------------
MaheshRavishankar wrote:

I am not immediately seeing why offsets and sizes have to have different constraints, but I am fine making this more restrictive as long as it doesnt cause regressions in existing use cases. I see that no tests were changed, so maybe this path isnt tested fully upstream. I am ok landing this as-is, but since both of us work on IREE, would be good to see if this causes any issues within IREE.

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


More information about the Mlir-commits mailing list