Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add array slice update IR node #1757

Open
meheff opened this issue Dec 2, 2024 · 0 comments
Open

Add array slice update IR node #1757

meheff opened this issue Dec 2, 2024 · 0 comments
Labels

Comments

@meheff
Copy link
Collaborator

meheff commented Dec 2, 2024

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=<true|false>)

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.

@meheff meheff added the ir label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant