[Mlir-commits] [mlir] [mlir][linalg] Fix padding shape computation in PadTilingInterface for convs (PR #149576)

Nicolas Vasilache llvmlistbot at llvm.org
Mon Jul 28 19:19:07 PDT 2025


================
@@ -148,6 +186,8 @@ SmallVector<OpFoldResult> linalg::computePaddedShape(
     AffineExpr sumExpr = dims.front();
     for (unsigned i = 1; i < dims.size(); ++i)
       sumExpr = sumExpr + dims[i];
+    // Add 1 to the maximum accessed index and get the final padded size.
+    sumExpr = sumExpr + rewriter.getAffineConstantExpr(1);
----------------
nicolasvasilache wrote:

`sumExpr = sumExpr + 1` should just work using this [overload](https://github.com/llvm/llvm-project/blob/28c2c1e06e2dc73df03cfc2d797fa70365d481f2/mlir/include/mlir/IR/AffineExpr.h#L153) 

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


More information about the Mlir-commits mailing list