[Mlir-commits] [mlir] [mlir][linalg] Restrict fill initial value type to output element type (PR #169567)

Quinn Dawkins llvmlistbot at llvm.org
Tue Nov 25 12:56:49 PST 2025


================
@@ -1057,35 +1057,66 @@ LogicalResult mlir::linalg::detail::verifyConvolutionInterface(Operation *op) {
 // FillOpInterface implementation
 //===----------------------------------------------------------------------===//
 
+namespace {
 enum class MatchFillResult {
   Success = 0,
   NotLinalgOp,
   WrongNumOperands,
-  NotScalarInput
+  NotScalarInput,
+  TypeMismatch
 };
 
-static MatchFillResult isFillInterfaceImpl(Operation *op) {
+struct FillInterfaceResult {
+  MatchFillResult result = MatchFillResult::Success;
+  Type scalarType;
+  Type outputElementType;
----------------
qedawkins wrote:

Is passing back the types here really worth it? The vast majority of matching cases won't ever populate these fields, and in the event we hit TypeMismatch, it's fairly easy to recover them on the caller's side.

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


More information about the Mlir-commits mailing list