[Mlir-commits] [mlir] [mlir][Vector] Remove more special case uses for extractelement/insertelement (PR #130166)

Andrzej WarzyƄski llvmlistbot at llvm.org
Mon Mar 10 03:38:22 PDT 2025


================
@@ -718,6 +718,7 @@ def Vector_ExtractOp :
   let results = (outs AnyType:$result);
 
   let builders = [
+    OpBuilder<(ins "Value":$source)>,
----------------
banach-space wrote:

IIUC, this builder is for extracting from rank-0 vector? Hence no indices? It's worth adding a comment.

Note, the "source" vector is basically the "indexed" argument for `vector.extract`:
* https://github.com/llvm/llvm-project/pull/130141

So, if that taxonomy makes sense, you can write:
```mlir
// A dedicated builder for when the "indexed" operand is rank-0 and hence no indices are required.
```

Identical comment for `vector.insert` (over there it's the "destination" operand that's "indexed")

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


More information about the Mlir-commits mailing list