[Mlir-commits] [mlir] [mlir][linalg] Fix tiling with constants in indexing maps (PR #173038)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Jan 8 14:55:52 PST 2026


================
@@ -692,3 +692,48 @@ module {
 //      CHECK:   %[[R:.*]] = linalg.reduce ins(%[[L]]
 // CHECK-SAME:       outs(%[[ARG2]] :
 //      CHECK:   return %[[R]]
+
+// -----
+
+// Check reduction that has constants in indexing maps. Issue #173025.
+
+module {
+  func.func @test(%arg0: tensor<1x4096x64xf32>, %arg1: tensor<1x1x64xf32>) -> tensor<1x1x64xf32> {
+    %0 = linalg.generic {
----------------
MaheshRavishankar wrote:

I was expecting this to be the case. The constant expression thing I think only works for the particular case when the dimensions are unit (and so the constant value is zero). Ideally we should drop this before hand using something like this https://github.com/llvm/llvm-project/blob/a651edf6e6b360fe213f64ae0bad2ded2e033760/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp#L547 as a pre-processing step. I am fine with your change to support this case with tiling, but I dont think it works for any const expression, but only for unit-extend dims and const expr being 0.

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


More information about the Mlir-commits mailing list