-
Notifications
You must be signed in to change notification settings - Fork 246
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
Structured control flow #9
Comments
It may be worthwhile to experiment and see if the desktop gpus already support unstructured controlflow in their Vulkan drivers so we can potentially push this problem a little bit ahead of us while we work towards a minimally viable product. |
From Intel.
Another contribution. |
Taking the Relooper approach seems like a good option for now. While not the most efficient, it would be a good start for me to get started with this kind of work and performance is likely not that important for the first prototype. |
This old issue is partially resolved now right @VZout ? |
There is a solution for the problem but not fully implemented yet. Currently only simple conditional branch's work. |
Ok np, could either create new one that tracks the progress support around this, or keep this one. up to you |
Closing in favor of #97 |
…tudios#1157) (EmbarkStudios#9) * bump glam to 0.29 * fix cargo deny * upgrade wgpu * fix cfg-check lints Co-authored-by: Gray Olson <gray@grayolson.com>
MIR internally is pretty much completely unstructured which leads to some problems since in the flavour of SPIR-V that we're trying to support the control flow needs to be fully structured. The only flavor that supports unstructured controlflow is for OpenCL.
This requires potentially quite a bit of engineering to solve since the algorithms involved are relatively complex.
One avenue of exploration could be to see if we can shoehorn the Mesa3d controlflow restructurizer back into our compile chain:
Another option would be to implement either Stackifier or Relooper as part of spirv-opt that we run after the fact. We may already need to run spirv-opt to run mem2reg since we'll mostly be emitting OpLoad and OpStore instead of sticking to SSA proper.
Another option is one that @MaikKlein proposed:
This option would leave the high-level controlflow constructs in tact without ever lowering them to branches/jumps which is a lot more robust then trying to reconstruct the structured controlflow from the jumps.
Some other projects have also run into similar issues:
rustc
team would accept such a change back into their mainline, or that they would support not breaking such a codepath.The text was updated successfully, but these errors were encountered: