[mlir] [mlir][linalg] Support subtracting accumulation in partial reduction … (PR #214033)

Andrzej Warzyński llvmlistbot at llvm.org
Thu Aug 6 12:17:54 PDT 2026


================
@@ -0,0 +1,62 @@
+// Checks that tiling a subtracting accumulation (`acc - x`) computes the same
+// result as the untiled reduction. The first RUN line runs the untiled
+// reduction, the second one tiles it first; both have to print the same values.
+
+// RUN: mlir-opt %s -test-transform-dialect-erase-schedule \
+// RUN: -empty-tensor-to-alloc-tensor -one-shot-bufferize="bufferize-function-boundaries" \
+// RUN: -buffer-deallocation-pipeline -convert-bufferization-to-memref -convert-linalg-to-loops -convert-scf-to-cf \
+// RUN: -expand-strided-metadata -lower-affine -convert-arith-to-llvm --finalize-memref-to-llvm -convert-func-to-llvm -convert-cf-to-llvm -reconcile-unrealized-casts | \
+// RUN: mlir-runner -e main -entry-point-result=void \
+// RUN:   -shared-libs=%mlir_c_runner_utils,%mlir_runner_utils \
+// RUN: | FileCheck %s
+
+// RUN: mlir-opt %s -transform-interpreter -test-transform-dialect-erase-schedule \
+// RUN: -empty-tensor-to-alloc-tensor -one-shot-bufferize="bufferize-function-boundaries" \
+// RUN: -buffer-deallocation-pipeline -convert-bufferization-to-memref -convert-linalg-to-loops -convert-scf-to-cf \
+// RUN: -expand-strided-metadata -lower-affine -convert-arith-to-llvm --finalize-memref-to-llvm -convert-func-to-llvm -convert-cf-to-llvm -reconcile-unrealized-casts | \
+// RUN: mlir-runner -e main -entry-point-result=void \
+// RUN:   -shared-libs=%mlir_c_runner_utils,%mlir_runner_utils \
+// RUN: | FileCheck %s
----------------
banach-space wrote:

It's very hard to see what the difference between these two is. Please re-structure with DEFINE + REDEFINE. Here's a basic example: https://github.com/llvm/llvm-project/blob/4b0b8cbac0f567cdacfde0c81019fc6c0d27f251/mlir/test/Integration/Dialect/Linalg/CPU/ArmSVE/matmul.mlir?plain=1#L1-L14

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


More information about the Mlir-commits mailing list