[Mlir-commits] [mlir] [mlir][linalg] Generic to category specialization (PR #184624)
Adam Siemieniuk
llvmlistbot at llvm.org
Fri Mar 6 01:11:06 PST 2026
================
@@ -406,8 +417,20 @@ static FailureOr<LinalgOp> specializeLinalgConvolutions(RewriterBase &rewriter,
//===----------------------------------------------------------------------===//
// Categorize linalg generic to named op where possible.
//===----------------------------------------------------------------------===//
-FailureOr<LinalgOp> mlir::linalg::specializeGenericOp(RewriterBase &rewriter,
- GenericOp genericOp) {
+FailureOr<LinalgOp>
+mlir::linalg::specializeGenericOp(RewriterBase &rewriter, GenericOp genericOp,
+ const SpecializationOptions &options) {
+ // Contraction - e.g. matmul
+ if (isaContractionOpInterface(genericOp)) {
+ return specializeLinalgContractions(rewriter, genericOp,
+ options.emitCategoryOps);
+ }
+
+ // Early exit in case of category specialization.
+ // TODO: Remove when all variants account for both named and category.
----------------
adam-smnk wrote:
Variants here as in the further cases, copy, fill etc., that'd specialize to unary and binary category ops.
I'll rephrase the comment.
https://github.com/llvm/llvm-project/pull/184624
More information about the Mlir-commits
mailing list