-
Notifications
You must be signed in to change notification settings - Fork 377
fix: Add a remove_unreachable_instructions SSA pass (with unreachable terminator) #9008
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
asterite
merged 38 commits into
master
from
ab/ssa-remove-unreachable-instructions-with-unreachable-terminator
Jun 24, 2025
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
38a5659
fix: add a `remove_unreachable_instructions` SSA pass
asterite 2702a7d
Add a regression test
asterite 1f59a54
Run it before removing unreachable functions
asterite d336b7d
Slightly improve pass name
asterite 1d80bd8
Simplify logic
asterite ea2378d
If a block is unreachable, its successors are too
asterite 36902d8
Traverse blocks in pre-order
asterite aaa9c0e
All successors are unreachable unless we saw them before
asterite d0d9ab2
Update snapshots
asterite cfa132a
Add all successors transitively right away
asterite 50ab93a
One more snapshot
asterite da3d2c2
DominatorTree to the rescue!
asterite f1eeaf2
Snapshots
asterite c4407d0
Merge branch 'master' into ab/ssa-remove-unreachable-instructions
asterite 5e2f39e
`simple_reachable_blocks_optimization` is fine
asterite 4d314ac
add_successors -> add_dominated_blocks
asterite b2b7865
More renames and comments
asterite 1375346
Comment
asterite 763ce42
Rename tests
asterite 9638edb
Add an unreachable terminator
asterite 426f390
Produce unreachable terminators
asterite cd83277
Assume unreachable can't be reached
asterite e21e963
Add a test for constrain not equal
asterite 5b7e58b
Snapshots
asterite 88ffc6d
Merge branch 'master' into ab/ssa-remove-unreachable-instructions
asterite f06f049
Fix comment
asterite 6118feb
Better handling of unreachable terminator
asterite 3b0cce7
Add another test
asterite 216941f
Remove unreachable instructions in the first SSA pass
asterite 77e8e75
Revert "Remove unreachable instructions in the first SSA pass"
asterite 6e4e138
Handle unreachable during inlining with a panic
asterite ad85129
A a regression for #8994
asterite 496d07a
Rename `remove_unreachable` to `remove_unreachable_functions`
asterite 2eeea5b
Merge branch 'master' into ab/ssa-remove-unreachable-instructions-wit…
asterite 1574951
No need to mark dominated blocks as unreachable
asterite 167f12c
Extract `always_fails`
asterite 1da08b5
Clarify comment
asterite 85a1c3c
Rename some tests
asterite File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.