-
Notifications
You must be signed in to change notification settings - Fork 244
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
New structurizer: now with ∞% more φ! #287
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
@@ -70,6 +80,7 @@ pub fn block_ordering_pass(func: &mut Function) { | |||
assert_eq!(func.blocks[0].label_id().unwrap(), entry_label); | |||
} | |||
|
|||
// FIXME(eddyb) use `Either`, `Cow`, and/or `SmallVec`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 ✅ 🆗 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either<Cow, SmallVec>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
ea577b9
to
be614a1
Compare
be614a1
to
84ff17a
Compare
#[test] | ||
#[ignore] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heck yee, love yeeting #[ignore]
s
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
OpPhi
s, 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".