[Mlir-commits] [mlir] [mlir][linalg] Align `elementwise` builder to do type-conversion of input to result type (PR #190566)

Julian Oppermann llvmlistbot at llvm.org
Mon Apr 27 01:25:29 PDT 2026


================
@@ -565,6 +565,12 @@ def ElementwiseOp : LinalgStructuredBase_Op<"elementwise", [
     The number of dims of the iterator-types are inferred from the rank of
     the result type.
 
+    The compute element type shall be the same as result type. For instance,
+    if input type is `f16` and result type `f32`, then input is upcast to
+    `f32` before doing the elementwise operation. Downcasting is not advised
+    but supported if user specifies, e.g. if input is `f32` and result `f16,
----------------
jopperm wrote:

Missing backtick.

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


More information about the Mlir-commits mailing list