[Mlir-commits] [mlir] [mlir][LinalgBlockPackMatmul] Add support for scalable block factors (PR #211354)
Adam Siemieniuk
llvmlistbot at llvm.org
Thu Jul 23 01:15:00 PDT 2026
================
@@ -161,8 +163,35 @@ linalg::blockPackMatmul(RewriterBase &rewriter, linalg::LinalgOp linalgOp,
if (options->blockFactors.size() != 3)
return rewriter.notifyMatchFailure(linalgOp, "require 3 tile factors");
- SmallVector<OpFoldResult> mnkTiles =
- getAsOpFoldResult(rewriter.getI64ArrayAttr(options->blockFactors));
+ bool hasScalable = !options->scalableBlockFactors.empty();
+ if (hasScalable && options->scalableBlockFactors.size() != 3)
+ return rewriter.notifyMatchFailure(
+ linalgOp, "scalableBlockFactors must be empty or have 3 elements");
+
+ // Scalable tile sizes are non-constant at compile time, so they can never
+ // satisfy the full-tile divisibility check. Reject early before creating
+ // any ops to avoid modifying IR before returning notifyMatchFailure.
+ if (!options->allowPadding && hasScalable)
+ return rewriter.notifyMatchFailure(
+ linalgOp, "scalable block factors require allow-padding=true");
----------------
adam-smnk wrote:
```suggestion
linalgOp, "scalable block factors require padding");
```
nit: more generic phrasing
https://github.com/llvm/llvm-project/pull/211354
More information about the Mlir-commits
mailing list