[Mlir-commits] [mlir] [mlir][vector] Handle corner cases in DropUnitDimsFromTransposeOp. (PR #102518)

Han-Chung Wang llvmlistbot at llvm.org
Thu Aug 8 11:46:28 PDT 2024


================
@@ -737,6 +737,18 @@ func.func @transpose_with_scalable_unit_dims(%vec: vector<[1]x1x2x4x1xf32>) -> v
 
 // -----
 
+func.func @transpose_with_all_unit_dims(%vec: vector<1x1x1xf32>) -> vector<1x1x1xf32> {
+  %res = vector.transpose %vec, [0, 2, 1] : vector<1x1x1xf32> to vector<1x1x1xf32>
+  return %res : vector<1x1x1xf32>
+}
+// The `vec` is returned because there are other flattening patterns fold
+// vector.shape_cast ops away.
----------------
hanhanW wrote:

done, thanks!

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


More information about the Mlir-commits mailing list