[mlir] [llvm] [mlir][tensor] Fold consumer linalg transpose with producer tensor pack (PR #74206)

lorenzo chelini via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 13 06:40:00 PST 2023


================
@@ -114,3 +114,212 @@ func.func @pad_pack_different_padding_value(%src: tensor<16641x16xf32>) -> tenso
 // CHECK-LABEL: func.func @pad_pack_different_padding_value
 // CHECK:         tensor.pad
 // CHECK:         tensor.pack
+
+// -----
+
+func.func @tensor_pack_linalg_transpose_fold(%arg0: tensor<56x57x1x64xf32>, %padding: f32) -> tensor<1x57x56x2x32xf32> {
----------------
chelini wrote:

Here, padding will probably fold; please, make the 64 a 55 so that the tile does not perfectly divide the dimension, and padding is actually necessary. See: https://github.com/llvm/llvm-project/commit/171cac95a7eb1526f4d18bf8f654275656183ce4

I would add a new test instead of updating an existing one.

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


More information about the llvm-commits mailing list