[Mlir-commits] [mlir] [mlir][armsme][vector] Replace splat with broadcast (PR #148024)
James Newling
llvmlistbot at llvm.org
Tue Jul 22 11:46:36 PDT 2025
================
@@ -790,11 +730,25 @@ struct ExtractFromCreateMaskToPselLowering
}
};
+// Convert all `vector.splat` to `vector.broadcast`. There is a path from
+// `vector.broadcast` to ArmSME via another pattern.
+struct ConvertSplatToBroadcast : public OpRewritePattern<vector::SplatOp> {
+ using OpRewritePattern<vector::SplatOp>::OpRewritePattern;
+
+ LogicalResult matchAndRewrite(vector::SplatOp splatOp,
+ PatternRewriter &rewriter) const final {
+
+ rewriter.replaceOpWithNewOp<vector::BroadcastOp>(splatOp, splatOp.getType(),
+ splatOp.getInput());
+ return success();
+ }
+};
+
----------------
newling wrote:
My here goal is to remove all splat-specific _logic_. This new pattern will be removed when we eventually remove `vector.splat`.
https://github.com/llvm/llvm-project/pull/148024
More information about the Mlir-commits
mailing list