[all-commits] [llvm/llvm-project] f42b76: [mlir][Vector] Add fold transpose(shape_cast) -> s...
Benjamin Maxwell via All-commits
all-commits at lists.llvm.org
Fri Dec 1 06:24:51 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: f42b7615b862bb5f77981f619f92877eb20adf54
https://github.com/llvm/llvm-project/commit/f42b7615b862bb5f77981f619f92877eb20adf54
Author: Benjamin Maxwell <benjamin.maxwell at arm.com>
Date: 2023-12-01 (Fri, 01 Dec 2023)
Changed paths:
M mlir/lib/Dialect/Vector/IR/VectorOps.cpp
M mlir/test/Dialect/Vector/canonicalize.mlir
Log Message:
-----------
[mlir][Vector] Add fold transpose(shape_cast) -> shape_cast (#73951)
This folds transpose(shape_cast) into a new shape_cast, when the
transpose just permutes a unit dim from the result of the shape_cast.
Example:
```
%0 = vector.shape_cast %vec : vector<[4]xf32> to vector<[4]x1xf32>
%1 = vector.transpose %0, [1, 0] : vector<[4]x1xf32> to vector<1x[4]xf32>
```
Folds to:
```
%0 = vector.shape_cast %vec : vector<[4]xf32> to vector<1x[4]xf32>
```
This is an (alternate) fix for lowering matmuls to ArmSME.
More information about the All-commits
mailing list