This repository was archived by the owner on Oct 31, 2025. It is now read-only.
New structurizer: now with ∞% more φ!#287
Merged
mergify[bot] merged 1 commit intoEmbarkStudios:mainfrom Dec 2, 2020
LykenSol:new-structurizer
Merged
New structurizer: now with ∞% more φ!#287mergify[bot] merged 1 commit intoEmbarkStudios:mainfrom LykenSol:new-structurizer
mergify[bot] merged 1 commit intoEmbarkStudios:mainfrom
LykenSol:new-structurizer
Conversation
khyperia
reviewed
Nov 30, 2020
Contributor
khyperia
left a comment
There was a problem hiding this comment.
I do not believe I am qualified to review new_structurizer.rs, nor am I going to try to other than a quick glance-over, because wow okay that's a lot of algorithm. Other than that, though, I think this is good to merge! (not hitting the approve button because mergify scares me)
| assert_eq!(func.blocks[0].label_id().unwrap(), entry_label); | ||
| } | ||
|
|
||
| // FIXME(eddyb) use `Either`, `Cow`, and/or `SmallVec`. |
VZout
approved these changes
Nov 30, 2020
Member
VZout
left a comment
There was a problem hiding this comment.
I assume cargo test was successful. Seems way better than my code& algorithm. Haven't ran spirv-cfg to see if I can see any weird things.
khyperia
approved these changes
Dec 2, 2020
| // fixed, a further underlying issue gets triggered instead, which is that the current structurizer | ||
| // doesn't handle this case. Remove `#[ignore]` once fixed. | ||
| #[test] | ||
| #[ignore] |
Contributor
There was a problem hiding this comment.
heck yee, love yeeting #[ignore]s
Merged
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.
Not sure this is ready, but it seems to handle everything I've thrown at it.
In an effort to test it, I came up with this silly example:
(click to open example code + graph rendering)
I was inspired by the loop-specific solution of "threading all exits through one
break(with a tag indicating which to take when outside the loop)" and tried to extend it to handle non-structural acyclic branches as well - the result is this PR.You can see all the
OpPhis, which are used to decide whether a "deferred exit" executes, when it's finally "fully accounted for" (or "owned"? not sure what the best terminology is) by a "region".Most of the implementation is a SEME -> SESE propagation (with the aforementioned "deferred exits"), which is then used to handle both acyclic and cyclic "regions".