[Mlir-commits] [mlir] [MLIR][Linalg] Fix insert_slice fusion with rank reduction (PR #130961)
Andrzej Warzyński
llvmlistbot at llvm.org
Wed Mar 26 02:24:10 PDT 2025
================
@@ -318,3 +318,50 @@ func.func @pad_generic_static(%small_input: tensor<58x1xf32>, %large_input: tens
}
return %for0 : tensor<64x128xf32>
}
+
+// -----
+
+func.func @rank_reduced_extract_slice(%cond : i1) -> tensor<6x2xf32> {
+ %cst = arith.constant 0.0 : f32
+ %cst1 = arith.constant 1.0 : f32
+
+ %empty1 = tensor.empty() : tensor<6x6x1x1x1x1xf32>
+ %init1 = linalg.generic {indexing_maps = [affine_map<(d0, d1, d2, d3, d4, d5) -> (d0, d1, d2, d3, d4, d5)>], iterator_types = ["parallel", "parallel", "parallel", "parallel", "parallel", "parallel"]} outs(%empty1 : tensor<6x6x1x1x1x1xf32>) {
----------------
banach-space wrote:
[nit] Would you be able to split this into multiple lines? I doesn't even fit in my browser 😅 There are some examples how to format `linalg.generic` higher up.
https://github.com/llvm/llvm-project/pull/130961
More information about the Mlir-commits
mailing list