[Mlir-commits] [mlir] [mlir][Vector] Allow elementwise/broadcast swap to handle mixed types (PR #151274)

Ivan Butygin llvmlistbot at llvm.org
Wed Jul 30 08:42:17 PDT 2025


================
@@ -1048,15 +1068,16 @@ struct ReorderElementwiseOpsOnBroadcast final
       SplatElementsAttr splatConst;
       if (matchPattern(operand, m_Constant(&splatConst))) {
         Attribute newConst;
-        if (auto shapedTy = dyn_cast<ShapedType>(firstBroadcastOrSplatType)) {
-          newConst = splatConst.resizeSplat(shapedTy);
+        Type elementType = getElementTypeOrSelf(operand.getType());
+        Type newType = cloneOrReplace(unbroadcastResultType, elementType);
+        if (auto shapedTy = dyn_cast<ShapedType>(unbroadcastResultType)) {
----------------
Hardcode84 wrote:

`shapedTy` is not used?

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


More information about the Mlir-commits mailing list