[all-commits] [llvm/llvm-project] 042800: [mlir][ArmSME] Add initial SME vector legalization...

Benjamin Maxwell via All-commits all-commits at lists.llvm.org
Wed Jan 31 03:55:34 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 042800a4dd79375ec0895c8959a43c86149232f3
      https://github.com/llvm/llvm-project/commit/042800a4dd79375ec0895c8959a43c86149232f3
  Author: Benjamin Maxwell <benjamin.maxwell at arm.com>
  Date:   2024-01-31 (Wed, 31 Jan 2024)

  Changed paths:
    M mlir/include/mlir/Dialect/ArmSME/Transforms/Passes.h
    M mlir/include/mlir/Dialect/ArmSME/Transforms/Passes.td
    M mlir/include/mlir/Dialect/ArmSME/Utils/Utils.h
    M mlir/lib/Dialect/ArmSME/IR/Utils.cpp
    M mlir/lib/Dialect/ArmSME/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/ArmSME/Transforms/VectorLegalization.cpp
    A mlir/test/Dialect/ArmSME/vector-legalization.mlir
    A mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/multi-tile-matmul.mlir
    A mlir/test/Integration/Dialect/Vector/CPU/ArmSME/test-multi-tile-transpose.mlir

  Log Message:
  -----------
  [mlir][ArmSME] Add initial SME vector legalization pass (#79152)

This adds a new pass (`-arm-sme-vector-legalization`) which legalizes
vector operations so that they can be lowered to ArmSME. This initial
patch adds decomposition for `vector.outerproduct`,
`vector.transfer_read`, and `vector.transfer_write` when they operate on
vector types larger than a single SME tile. For example, a [8]x[8]xf32
outer product would be decomposed into four [4]x[4]xf32 outer products,
which could then be lowered to ArmSME. These three ops have been picked
as supporting them alone allows lowering matmuls that use all ZA
accumulators to ArmSME.

For it to be possible to legalize a vector type it has to be a multiple
of an SME tile size, but other than that any shape can be used. E.g.
`vector<[8]x[8]xf32>`, `vector<[4]x[16]xf32>`, `vector<[16]x[4]xf32>`
can all be lowered to four `vector<[4]x[4]xf32>` operations.

In future, this pass will be extended with more SME-specific rewrites to
legalize unrolling the reduction dimension of matmuls (which is not
type-decomposition), which is why the pass has quite a general name.




More information about the All-commits mailing list