[Mlir-commits] [mlir] [mlir][Vector] Add fold transpose(shape_cast) -> shape_cast (PR #73951)

Adam Paszke llvmlistbot at llvm.org
Wed Dec 6 02:07:42 PST 2023


apaszke wrote:

This folding rules seems wrong to me? It does not even look at the transpose pattern of the non-unit dims? I have code that looks like this:
```
%22 = vector.shape_cast %21 : vector<1x256x256xf32> to vector<256x256xf32>
%23 = vector.transpose %22, [1, 0] : vector<256x256xf32> to vector<256x256xf32>
```
and it gets simplified to
```
%22 = vector.shape_cast %21 : vector<1x256x256xf32> to vector<256x256xf32>
```
which obviously produces different values!

https://github.com/llvm/llvm-project/pull/73951


More information about the Mlir-commits mailing list