Skip to content

ZJIT: Remove duplicate CheckInterrupts within basic blocks#16317

Merged
tekknolagi merged 1 commit intoruby:masterfrom
Shopify:rwstauner/rm-dup-checkinterrupts
Mar 6, 2026
Merged

ZJIT: Remove duplicate CheckInterrupts within basic blocks#16317
tekknolagi merged 1 commit intoruby:masterfrom
Shopify:rwstauner/rm-dup-checkinterrupts

Conversation

@rwstauner
Copy link
Contributor

Add a new optimization pass that eliminates redundant CheckInterrupts instructions within each basic block. Only the first CheckInterrupts is needed per stretch of non-call code, since the interrupt flag only needs to be checked once. The flag resets when an intervening instruction writes to InterruptFlag (e.g. a Send).

@matzbot matzbot requested a review from a team March 6, 2026 00:07
Copy link
Contributor

@tekknolagi tekknolagi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to upgrade your insta to get rid of those errant writes to otherwise unchanged test snapshots but otherwise lgtm

Add a new optimization pass that eliminates redundant CheckInterrupts
instructions within each basic block. Only the first CheckInterrupts is
needed per stretch of non-call code, since the interrupt flag only needs
to be checked once. The flag resets when an intervening instruction
writes to InterruptFlag (e.g. a Send).
@rwstauner rwstauner force-pushed the rwstauner/rm-dup-checkinterrupts branch from 715a52c to c86d913 Compare March 6, 2026 03:03
@tekknolagi tekknolagi enabled auto-merge (squash) March 6, 2026 03:14
@tekknolagi tekknolagi merged commit 7a1d47a into ruby:master Mar 6, 2026
92 checks passed
@tekknolagi tekknolagi deleted the rwstauner/rm-dup-checkinterrupts branch March 6, 2026 03:33
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