Skip to content

Improve ReFinalize::replaceUntaken #7740

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

Merged
merged 2 commits into from
Jul 22, 2025
Merged

Conversation

tlively
Copy link
Member

@tlively tlively commented Jul 22, 2025

ReFinalize replaces unreachable branches with unreachable blocks so that
it can possibly propagate the unreachability up to the former branch
target. It previously only did this for branches whose sent values (as
opposed to their conditions) were unreachable, except for BrOn, where it
could erroneously optimize when the sent value was reachable and the
descriptor was unreachable. This was incorrect because replaceUntaken
assumed that the sent value was unreachable.

Rather than fix the bug for BrOn, generalize replaceUntaken to work
no matter whether the sent value or the other child exists or is the
source of unreachability.

ReFinalize replaces unreachable branches with unreachable blocks so that
it can possibly propagate the unreachability up to the former branch
target. It previously only did this for branches whose sent values (as
opposed to their conditions) were unreachable, except for BrOn, where it
could erroneously optimize when the sent value was reachable and the
descriptor was unreachable. This was incorrect because `replaceUntaken`
assumed that the sent value was unreachable.

Rather than fix the bug for BrOn, generalize `replaceUntaken` to work
no matter whether the sent value or the other child exists or is the
source of unreachability.
@tlively tlively requested a review from kripken July 22, 2025 05:31
@tlively tlively enabled auto-merge (squash) July 22, 2025 17:52
@tlively tlively merged commit 90e98db into main Jul 22, 2025
16 checks passed
@tlively tlively deleted the refinalize-untaken-improvement branch July 22, 2025 18:25
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