[Mlir-commits] [mlir] [mlir][linalg] Fix EraseIdentityLinalgOp on fill-like ops (PR #130000)

Andrzej WarzyƄski llvmlistbot at llvm.org
Wed May 28 02:04:07 PDT 2025


================
@@ -431,6 +431,25 @@ func.func @fold_self_copy(%0 : memref<4x16xf32>) {
 
 // -----
 
+// CHECK-LABEL: func @no_fold_fill_like
+//       CHECK:   %[[VAL0:.+]] = arith.constant 0.000000e+00 : f32
+//       CHECK:   linalg.generic 
+//       CHECK:     linalg.yield %[[VAL0]] : f32
+func.func @no_fold_fill_like(%0 : memref<4x16xf32>) {
+  %1 = arith.constant 0.0 : f32
----------------
banach-space wrote:

Lets reduce the number of Ops in this test and make `%1` a function argument. Some more descriptive variable names would also be nice (e.g. `%0` -> `%in_out`, `%1` -> `%fill_val`/`%cst`).

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


More information about the Mlir-commits mailing list