Improve hackability for VM lists
- Dominant language
- C++
- Stars
- 3.9k
- Forks
- 1k
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 47
Description
Would be nice to have `!vm.list` support index elements enough to allow for type conversion (so you could author `!vm.list` and have it switch to i32 or i64 based on target VM configuration). If there was a standard list we could avoid this; or we could have an intermediate `!iree.list` that let the lowering take care of things (would also avoid the need to leak `vm` as high up in the stack).
Would also be nice to have a `vm.list.reset` that took a variadic list of args and did the resize + sets. This would shrink the IR a lot (and be better at runtime too).
Motivating example, to build a shape:
```mlir
%rank = constant 4 : i32
vm.list.resize %shape, %rank : (!vm.list, i32)
%i0 = constant 0 : i32
%i1 = constant 1 : i32
%i2 = constant 2 : i32
%i3 = constant 3 : i32
%c1 = constant 1 : i32
%c3 = constant 3 : i32
%c8 = constant 8 : i32
vm.list.set.i32 %shape, %i0, %c1 : (!vm.list, i32, i32)
vm.list.set.i32 %shape, %i1, %c8 : (!vm.list, i32, i32)
vm.list.set.i32 %shape, %i2, %c8 : (!vm.list, i32, i32)
vm.list.set.i32 %shape, %i3, %c3 : (!vm.list, i32, i32)
```
Contributor guide
Research direction
Start by tracing the existing vm.list.resize and vm.list.set.i32 operations shown in the MLIR example. Clarify whether indexed type conversion, an intermediate !iree.list, or vm.list.reset is in scope; done requires an agreed design and defined behavior for the motivating shape-building case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100