[Mlir-commits] [mlir] [mlir][Linalg][Tensor] Preserve attrs on `tensor.pad` when lowering to dst-style (PR #182064)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Feb 19 09:05:17 PST 2026


================
@@ -96,39 +97,44 @@ static Operation *movePaddingToFillOrGenericOp(RewriterBase &rewriter,
   OpBuilder::InsertionGuard g(rewriter);
   RankedTensorType resultType = padOp.getResultType();
 
-  // Examine the yielded value to decide if a linalg.generic is neede or a
+  // Collect user/dialect attributes from the pad op to preserve on the newly
+  // created ops.
+  SmallVector<NamedAttribute> preservedAttrs =
+      getPrunedAttributeList(padOp, PadOp::getAttributeNames());
+
+  // Examine the yielded value to decide if a linalg.generic is needed or a
   // linalg.fill is sufficient.
   Value yieldedValue =
       cast<tensor::YieldOp>(padOp.getBody()->getTerminator()).getValue();
   Attribute constYieldedValue;
+  const bool isConstYieldedValue =
----------------
MaheshRavishankar wrote:

I think a const scalar value is not something that fits within LLVM/MLIR coding conventions (and dont think it buys you much).

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


More information about the Mlir-commits mailing list