[Mlir-commits] [mlir] [mlir][vector] vector.splat deprecation: folding/canonicalizing parity with broadcast (PR #150284)

Jakub Kuderski llvmlistbot at llvm.org
Wed Jul 23 12:18:23 PDT 2025


================
@@ -7226,6 +7242,23 @@ OpFoldResult SplatOp::fold(FoldAdaptor adaptor) {
   return SplatElementsAttr::get(getType(), {constOperand});
 }
 
+// Canonicalizer for vector.splat. It always gets canonicalized to a
+// vector.broadcast.
+class SplatToBroadcastPattern : public OpRewritePattern<SplatOp> {
+public:
----------------
kuhar wrote:

```suggestion
class SplatToBroadcastPattern final : public OpRewritePattern<SplatOp> {
public:
```

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


More information about the Mlir-commits mailing list