Skip to content
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 #97

Closed
7 of 11 tasks
VZout opened this issue Oct 22, 2020 · 3 comments
Closed
7 of 11 tasks

Structured Control Flow #97

VZout opened this issue Oct 22, 2020 · 3 comments
Assignees
Labels
t: tracking issue An issue tracking the progress of a specific feature or change.

Comments

@VZout
Copy link
Member

VZout commented Oct 22, 2020

For non-kernel shaders SPIR-V requires you to mark structured control flow with merge instructions.

Primary Tasks:

  • Conditional Branch
  • Loops - in progress
    • break (partially unreachable)
    • break (fully unreachable)
    • continue
    • return
  • Switch

Secondary Tasks:

  • Find convergence points using post-dominator tree algorithm instead of my approach.
  • Optimize loop detection.
  • Reduce duplicate code.

Backlog:

  • "make reducible" pass.
    • The MIR generated from rust is currently reducible. This might change in the future or we might have missed a corner case.
@VZout VZout added the t: tracking issue An issue tracking the progress of a specific feature or change. label Oct 22, 2020
@VZout VZout self-assigned this Oct 22, 2020
@VZout VZout changed the title Structured Control Flow - Tracking Structured Control Flow Oct 22, 2020
@XAMPPRocky XAMPPRocky mentioned this issue Oct 22, 2020
18 tasks
@arirawr arirawr pinned this issue Oct 22, 2020
@Maaarcocr
Copy link

Hey! I know that loops are in progress, but I would be happy to help with them if there was any subtask that you may want to offload to an open source contributor!

I have some experience with structured control flow, in the past I've worked on a SPMD pass on top of the Julia IR. I'll also be more than happy to work on switch!

@khyperia
Copy link
Contributor

Reminder for us: NO_DCE=1 is broken right now (hangs for a long time - infinitely? - in the structurization pass). We should add NO_DCE=1 to tests once we fix that.

@VZout
Copy link
Member Author

VZout commented Oct 26, 2020

Hey! I know that loops are in progress, but I would be happy to help with them if there was any subtask that you may want to offload to an open source contributor!

I have some experience with structured control flow, in the past I've worked on a SPMD pass on top of the Julia IR. I'll also be more than happy to work on switch!

Hey thanks for the offer. I expect to get loops and switches in before the end of the week. But if you want to look into creating a irreducible -> reducible pass that would be very helpful for us in the future. However I believe the plan is to strip the structuration pass and put it into SPIRV-TOOLS once we have the reducible pass since it may be off help to many more people. If you want to talk more in-depth you can always talk to me on the Embark discord.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t: tracking issue An issue tracking the progress of a specific feature or change.
Projects
None yet
Development

No branches or pull requests

3 participants