[Mlir-commits] [mlir] [MLIR][Linalg] Fix insert_slice fusion with rank reduction (PR #130961)

Andrzej WarzyƄski llvmlistbot at llvm.org
Tue Mar 25 04:55:25 PDT 2025


================
@@ -318,3 +318,66 @@ func.func @pad_generic_static(%small_input: tensor<58x1xf32>, %large_input: tens
   }
   return %for0 : tensor<64x128xf32>
 }
+
+// -----
+
+func.func @rank_reduced_extract_slice(%arg0: tensor<6x6x1x1x1x1xf32>, %arg1: tensor<6x6x1x1xf32>, %arg2: tensor<4x6xf32>) -> tensor<4x6xf32> {
----------------
banach-space wrote:

This test is a bit dense. I have a few suggestions.

1. Would it still work if you replaced the current `linalg.generic`s with something simpler (reducing the number of `arith` Ops would already be a win).
2. Could you add empty lines as in the example above?
3. Could you try using naming consistent with the example above? (e.g. `%0` -> `%gen1` or `%wide_madmul`, `%arg0` -> `%wide_src`)

Hopefully that's not too much work, this looks mostly good.

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


More information about the Mlir-commits mailing list