[Mlir-commits] [mlir] [[mlir][linalg] Infer reduction-neutral padding values in rewriteAsPaddedOp (PR #216517)

Andrzej WarzyƄski llvmlistbot at llvm.org
Sun Sep 13 11:00:33 PDT 2026


================
@@ -263,6 +266,151 @@ static Value padOperand(OpBuilder &builder, TilingInterface opToPad,
                                paddingValue, /*nofold=*/false, dynDims);
 }
 
+/// Returns true if `operand` is indexed along at least one reduction dimension
+/// of `linalgOp`
+static bool isReducedOperand(linalg::LinalgOp linalgOp, OpOperand *operand,
+                             ArrayRef<utils::IteratorType> iterTypes) {
+  AffineMap map = linalgOp.getMatchingIndexingMap(operand);
+  return llvm::any_of(llvm::enumerate(iterTypes), [&](auto it) {
+    return it.value() == utils::IteratorType::reduction &&
+           map.isFunctionOfDim(it.index());
+  });
+}
+
+/// Returns `defaults` with the entry of every input of `linalgOp` that is
----------------
banach-space wrote:

Suggestion - replace the starting sentence with:
> On success, returns a vector with pad values for every operand of `linalgOp`.

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


More information about the Mlir-commits mailing list