[Mlir-commits] [mlir] [mlir][linalg] Type conversion of operands in new elementwise-op. (PR #131542)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Mar 24 22:57:24 PDT 2025


================
@@ -587,7 +590,8 @@ def ElementwiseOp : LinalgStructuredBase_Op<"elementwise", [
       Variadic<AnyType>:$inputs,
       Variadic<AnyShaped>:$outputs,
       ElementwiseKindAttr:$kind,
-      DefaultValuedOptionalAttr<AffineMapArrayAttr, "{}">:$indexing_maps
+      DefaultValuedOptionalAttr<AffineMapArrayAttr, "{}">:$indexing_maps,
+      DefaultValuedOptionalAttr<TypeFnAttr, "TypeFn::cast_signed">:$cast
----------------
MaheshRavishankar wrote:

I think it would be better to make this a list of `TypeFnAttr` which allows for a sentinel `none` if no castin is required. Some parser/printer helpers can allow something like `[cast_signed, -]` to say no casting is needed. I'd also say this list should be off the size of the number of `ins` operands.


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


More information about the Mlir-commits mailing list