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

Quinn Dawkins llvmlistbot at llvm.org
Thu Nov 6 20:50:05 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);
----------------
qedawkins wrote:

I can make it common. When I first wrote this I didn't understand why we were ignoring non-AffineDimExprs in the above matcher and made this one a little more restrictive but I can update the same there.

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


More information about the Mlir-commits mailing list