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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Nov 5 22:52:41 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:

Again I am not sure about why we need this. In theory it is feasible to fuse with any producer, irrespective of what slice of the operand is used. This seems like a cost function, rather than a structural requirement for fusion.

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


More information about the Mlir-commits mailing list