[Mlir-commits] [mlir] [mlir][Vector] Add a dedicated Transform Dialect op for `UnrollContractPattern` (PR #230543)
Federico Bruzzone
llvmlistbot at llvm.org
Mon Oct 12 16:45:56 PDT 2026
================
@@ -0,0 +1,48 @@
+// RUN: mlir-opt %s -transform-preload-library='transform-library-paths=%p/td/unroll-contract.mlir' \
+// RUN: -transform-interpreter=entry-point=unroll_contract --split-input-file | FileCheck %s
+
+//===----------------------------------------------------------------------===//
+// Test UnrollContractionPattern
+//===----------------------------------------------------------------------===//
+// CHECK-LABEL: @matmul
+func.func @matmul(%mask: vector<8x8x4xi1>, %lhs: vector<8x4xf32>, %rhs: vector<4x8xf32>, %acc: vector<8x8xf32>) -> vector<8x8xf32> {
+
+// CHECK-REPEAT-8: vector.contract {{.*}} : vector<1x4xf32>, vector<4x8xf32> into vector<1x8xf32>
+ %res = vector.contract {
+ indexing_maps = [affine_map<(m, n, k) -> (m, k)>, affine_map<(m, n, k) -> (k, n)>, affine_map<(m, n, k) -> (m, n)>],
+ iterator_types = ["parallel", "parallel", "reduction"],
+ kind = #vector.kind<add>}
+ %lhs, %rhs, %acc : vector<8x4xf32>, vector<4x8xf32> into vector<8x8xf32>
+
+ return %res : vector<8x8xf32>
+}
+
+// -----
+
+// CHECK-LABEL: @negative_batched_matmul
+func.func @negative_batched_matmul(%mask: vector<1x8x8x4xi1>, %lhs: vector<1x8x4xf32>, %rhs: vector<1x4x8xf32>, %acc: vector<1x8x8xf32>) -> vector<1x8x8xf32> {
----------------
FedericoBruzzone wrote:
We want this to be _negative_, right? For now, are we only handling *plain* matmul?
https://github.com/llvm/llvm-project/pull/230543
More information about the Mlir-commits
mailing list