Skip to content

Change effect for pause#8401

Merged
tlively merged 1 commit intomainfrom
pause-effect
Feb 27, 2026
Merged

Change effect for pause#8401
tlively merged 1 commit intomainfrom
pause-effect

Conversation

@tlively
Copy link
Member

@tlively tlively commented Feb 27, 2026

The pause instruction doesn't have observable side effects, but for it
to fulfill its purpose of making spinlocks more efficient, we need to
avoid moving it out of loops. We previously did this by setting the
isAtomic effect, but that effect will soon go away in favor of a more
detailed analysis of how expressions may synchronize across threads.
Switch to using branchesOut as the effect to keep pause from being
moved instead and add a test demonstrating that it works as intended.

The `pause` instruction doesn't have observable side effects, but for it
to fulfill its purpose of making spinlocks more efficient, we need to
avoid moving it out of loops. We previously did this by setting the
`isAtomic` effect, but that effect will soon go away in favor of a more
detailed analysis of how expressions may synchronize across threads.
Switch to using `branchesOut` as the effect to keep `pause` from being
moved instead and add a test demonstrating that it works as intended.
@tlively tlively merged commit 7317be6 into main Feb 27, 2026
17 checks passed
@tlively tlively deleted the pause-effect branch February 27, 2026 22:27
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.

3 participants