[Mlir-commits] [mlir] [mlir] [vector] try promoting scalar when reordering broadcast/elementwise (PR #212180)
Chuanqi Xu
llvmlistbot at llvm.org
Mon Aug 24 01:50:25 PDT 2026
================
@@ -1046,41 +1046,54 @@ struct ReorderElementwiseOpsOnBroadcast final
Type resultElemType = resultType.getElementType();
- // Get the type of the first non-constant operand
+ // Prefer a vector source when one is available. This is important for
+ // mixed scalar/vector broadcasts: the vector source determines the shape
+ // to which the scalar is promoted.
----------------
ChuanqiXu9 wrote:
Done by updating the comments. Is it clear now?
> I am also not sure whether we need a loop. IIUC, there will almost always be either one or two operands? Why not just check both?
I think the reason is, e.g., the fma can have 3 operands.
https://github.com/llvm/llvm-project/pull/212180
More information about the Mlir-commits
mailing list