[Mlir-commits] [mlir] [mlir][Vector] Add `vector.to_elements` op (PR #141457)

Diego Caballero llvmlistbot at llvm.org
Fri May 30 12:36:32 PDT 2025


dcaballe wrote:

> do we need to keep vector.extract at all?

That's a good point! For `vector.insert` it's clear that we need it because we need a way to override only one or a few elements of a vector. For `vector.extract`, I'm not sure... We may end up with quite some dead values that couldn't be optimized away:

```
func.func (%a: vector<512xf32>) {
   %0:512 = vector.to_elements %a : vector<512x32>
   user_op %0#0
   return
}
```

I also anticipate redundant `vector.to_elements` extracting from the same vector when the IR hasn't been CSE'ed.
This would be a concern for memory consumption?

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


More information about the Mlir-commits mailing list