Add array slice update IR node
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 283
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 135
Description
For array types in the IR we the following ops:
* array_index : return individual element
* array_slice: return contiguous elements
* array_update : update individual element
But we don't have a way of updating contiguous elements of an array (ie, array_slice_update). This is a hole in our IR semantics.
Possible definition of new op:
```
result = array_update_slice(array, slice, indices=[idx_{0}, ... , idx_{N-1}], assumed_in_bounds=)
```
Where:
- `array`: array of at least N dimensions with element type T
- `slice`: array of type T[K]
- `index_{i}`: arbitrary bits types
- `result`: same type as `array`
Returns a copy of the input array with the K elements starting at the given indices replaced with the elements of `slice`. Elements of the slice to update which fall out of bounds of `array` are ignored.
Contributor guide
Assessment
This issue has not been assessed yet.