This repository was archived by the owner on Oct 31, 2025. It is now read-only.
structurizer: split regions into Divergent vs Convergent, and optimize based on that.#574
Closed
eddyb wants to merge 3 commits intoEmbarkStudios:mainfrom
LykenSol:structurizer-condivergement
Closed
structurizer: split regions into Divergent vs Convergent, and optimize based on that.#574eddyb wants to merge 3 commits intoEmbarkStudios:mainfrom LykenSol:structurizer-condivergement
Divergent vs Convergent, and optimize based on that.#574eddyb wants to merge 3 commits intoEmbarkStudios:mainfrom
LykenSol:structurizer-condivergement
Conversation
khyperia
reviewed
Apr 1, 2021
Contributor
khyperia
left a comment
There was a problem hiding this comment.
Seems good to me! Type saftey with different types for divergent/convergent is probably kinda nice, makes you think about things instead of writing generic code for both, so I'd probably be in favor of keeping it if you like it.
| merge_id: block_id, | ||
| exits: indexmap! {}, | ||
| }, | ||
| Op::Return | Op::ReturnValue | Op::Kill | Op::Unreachable => Region::Divergent, |
Contributor
There was a problem hiding this comment.
Just a note here that this will conflict with #563, and it might not be immediately obvious if a merge goes wonky here, so note to double check a merge goes well
Contributor
Author
|
Closing in favor of SPIR-T (which has its own structurizer, with a different design). |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The first commit is a pretty large refactor that ended up a bit worse than I expected.
We might just want to have this instead (and call it in a few places):
The second commit is just an on-the-fly
OpPhisimplification that we should probably merge completely separately.And the third commit is "clever hack" (to remove some unnecessary empty blocks, see example below) that could also probably be done without the first commit, it just didn't hit me that it was possible before the refactor.
(click to open example code & before/after graphs for the third commit)
Before
After