iree-org / iree-org/iree

Add `iree_vm_list_swap_storage` and expose as `vm.list.swap`.

Open
#7,014 5 comments 1 reaction 0 assignees View on GitHub
compiler/dialects good first issue 🌱 runtime/vm
Dominant language
C++
Stars
3.9k
Forks
1k
Avg merge
4d 16h
Merged PRs (30d)
47

Description

ala https://www.cplusplus.com/reference/vector/vector/swap/

```mlir
vm.list.swap %list0, %list1 : !vm.list
```

```c
iree_status_t iree_vm_list_swap_storage(iree_vm_list_t* a, iree_vm_list_t* b);
```

must fail if the list was allocated on the stack; this could happen if a list passed in via the C API was allocated on-stack by the user, but that's fine to bail on (with a nice error message).

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing iree_vm_list_t storage APIs and vm.list operations, then trace how the C API maps to MLIR VM syntax. Confirm the requested swap behavior for heap-backed lists and the required clear failure for stack-allocated lists; done means both iree_vm_list_swap_storage and vm.list.swap are exposed with that validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend-api-design, compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.