[Mlir-commits] [mlir] [mlir] [vector] Allow element/broadcast re-order for FMA if the source is a vector (PR #211208)

Diego Caballero llvmlistbot at llvm.org
Fri Jul 24 04:23:08 PDT 2026


================
@@ -1068,6 +1062,17 @@ struct ReorderElementwiseOpsOnBroadcast final
     Type unbroadcastResultType =
         cloneOrReplace(broadcastSource.getType(), resultElemType);
 
+    // Some ops, e.g. `vector.fma`, only accept vector types. For such ops the
+    // reordering is only possible when the broadcast source is a vector as
+    // well; sinking past a broadcast from a scalar would create an invalid op.
+    // TODO: Support scalar sources for `vector.fma` by rewriting to
+    // `math.fma`.
----------------
dcaballe wrote:

I'm not sure the semantics of `math.fma` match `vector.fma`. This would probably be better supported by promoting the scalar to a single element vector

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


More information about the Mlir-commits mailing list