Skip to content

[NFC] Handle atomic arrays in Heap2Local#8549

Merged
tlively merged 1 commit intomainfrom
heap2local-atomic-array
Mar 30, 2026
Merged

[NFC] Handle atomic arrays in Heap2Local#8549
tlively merged 1 commit intomainfrom
heap2local-atomic-array

Conversation

@tlively
Copy link
Copy Markdown
Member

@tlively tlively commented Mar 30, 2026

We previously had TODOs about handling atoimc arrays in the Array2Struct helper in the Heap2Local pass. However, we were already handling them correctly. When Array2Struct transformed an array get or set into a struct get or set, it did not previously preserve the memory order of the array access. But this tranformation only happens when the new struct access will also be subsequently optimized out, so the ordering does not matter. Update the code to preserve order anyway, since that is less surprising, and add some tests.

We previously had TODOs about handling atoimc arrays in the Array2Struct helper in the Heap2Local pass. However, we were already handling them correctly. When Array2Struct transformed an array get or set into a struct get or set, it did not previously preserve the memory order of the array access. But this tranformation only happens when the new struct access will also be subsequently optimized out, so the ordering does not matter. Update the code to preserve order anyway, since that is less surprising, and add some tests.
@tlively tlively requested a review from a team as a code owner March 30, 2026 20:56
@tlively tlively requested a review from kripken March 30, 2026 20:56
@tlively tlively enabled auto-merge (squash) March 30, 2026 21:15
@tlively tlively merged commit 0380ce9 into main Mar 30, 2026
16 checks passed
@tlively tlively deleted the heap2local-atomic-array branch March 30, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants