[all-commits] [llvm/llvm-project] fae396: [mlir][linalg] Add an e2e test for linalg.matmul t...

Cullen Rhodes via All-commits all-commits at lists.llvm.org
Thu Nov 23 00:53:57 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fae3964cbc6d27e89f93d6579f2e8188f240e6cb
      https://github.com/llvm/llvm-project/commit/fae3964cbc6d27e89f93d6579f2e8188f240e6cb
  Author: Cullen Rhodes <cullen.rhodes at arm.com>
  Date:   2023-11-23 (Thu, 23 Nov 2023)

  Changed paths:
    A mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/matmul.mlir

  Log Message:
  -----------
  [mlir][linalg] Add an e2e test for linalg.matmul to ArmSME (#72144)

This patch adds an integration test lowering a linalg.matmul to SME via
vector.outerproduct.

It's similar to the linalg.matmul_transpose_a e2e test added recently in
as well as vector transpose canonicalizations, to lower the following
sequence (taken from the inner loop):
```
  %subview = memref.subview %arg0[%arg3, %arg5] [%2, 1] [1, 1] :
    memref<?x?xf32, strided<[?, ?], offset: ?>> to memref<?x1xf32, strided<[?, ?], offset: ?>>
  %mask = vector.create_mask %2, %c1 : vector<[4]x1xi1>
  %0 = vector.transfer_read %subview[%c0, %c0], %pad, %mask {in_bounds = [true, true]} :
    memref<?x1xf32, strided<[?, ?], offset: ?>>, vector<[4]x1xf32>
  %1 = vector.transpose %0, [1, 0] : vector<[4]x1xf32> to vector<1x[4]xf32>
  %2 = vector.extract %1[0] : vector<[4]xf32> from vector<1x[4]xf32>
```
Rank-2 vectors with leading scalable dim can't be type converted to an
array. TransferReadDropUnitDimsPattern drops the unit dim on the
vector.transfer_read so it can be lowered via the generic path (to SVE).
The transpose canonicalizations lower the transpose to a shape_cast
which folds away.




More information about the All-commits mailing list