[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:24 PDT 2025


================
@@ -1288,19 +1288,47 @@ LogicalResult vector::ExtractElementOp::verify() {
   return success();
 }
 
+/// Consider the defining operation `defOp` of `value`. If `defOp` is a
+/// vector.splat or a vector.broadcast with a scalar operand, return the scalar
+/// value that is splatted. Otherwise return null.
+///
+/// Cases where null is not returned:
+///
+/// scalar_source --> vector.splat --> value     - return scalar_source
+/// scalar_source --> vector.broadcast --> value - return scalar_source
+static Value getSplatSource(Value value) {
+
+  // Block argument:
----------------
kuhar wrote:

```suggestion
static Value getSplatSource(Value value) {
  // Block argument:
```

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


More information about the Mlir-commits mailing list