[all-commits] [llvm/llvm-project] 88accd: [mlir][ArmSME] Pattern to swap shape_cast(tranpose...

Benjamin Maxwell via All-commits all-commits at lists.llvm.org
Fri Jul 26 06:46:12 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 88accd9aaa20c6a30661c48cc2ca6dbbdf991ec0
      https://github.com/llvm/llvm-project/commit/88accd9aaa20c6a30661c48cc2ca6dbbdf991ec0
  Author: Benjamin Maxwell <benjamin.maxwell at arm.com>
  Date:   2024-07-26 (Fri, 26 Jul 2024)

  Changed paths:
    M mlir/lib/Dialect/ArmSME/Transforms/VectorLegalization.cpp
    M mlir/test/Dialect/ArmSME/vector-legalization.mlir

  Log Message:
  -----------
  [mlir][ArmSME] Pattern to swap shape_cast(tranpose) with transpose(shape_cast) (#100731)

This applies when the shape_cast is simply for dropping unit dims, and
the result rank is >= 2.

This simplifies the transpose making it possible for other ArmSME
legalization patterns to handle it.

Example:

```mlir
%0 = vector.transpose %vector, [3, 0, 1, 2]
       : vector<1x1x4x[4]xf32> to vector<[4]x1x1x4xf32>
%1 = vector.shape_cast %0 : vector<[4]x1x1x4xf32> to vector<[4]x4xf32>
```

```mlir
%0 = vector.shape_cast %arg0 : vector<1x1x4x[4]xf32> to vector<4x[4]xf32>
%1 = vector.transpose %0, [1, 0] : vector<4x[4]xf32> to vector<[4]x4xf32>
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list