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

OpSwitchBlockDominatesAllItsCases #37

Open
vili-1 opened this issue Sep 29, 2021 · 1 comment
Open

OpSwitchBlockDominatesAllItsCases #37

vili-1 opened this issue Sep 29, 2021 · 1 comment

Comments

@vili-1
Copy link
Collaborator

vili-1 commented Sep 29, 2021

In this example the OpSwitch %21 does not structurally dominate its case %20.
s045

@afd
Copy link
Member

afd commented Oct 1, 2021

This is a very interesting example!

The edge 21->20 goes directly from the header of a switch construct to the continue target of a loop that encloses the switch construct.

The current SPIR-V specification says:

a case construct: the blocks dominated by an OpSwitch Target or Default (this construct is only defined for those OpSwitch Target or Default that are not equal to the OpSwitch’s corresponding merge block)

According to this definition, block 20 is indeed a case construct, and if 20 dominated more blocks (which it doesn't here), these would be part of the case construct.

That seems wrong, because the branch 21->20 is an "early continue" branch.

I think the spec should be adapted to say:

a case construct: the blocks dominated by an OpSwitch Target or Default (this construct is only defined for those OpSwitch Target or Default that are not equal to the OpSwitch’s corresponding merge block, and that are not equal to the merge or continue block of a loop containing the OpSwitch instruction)

Or something along those lines.

If we added that language, 20 would no longer be a case construct and the problem would go away.

What do you think, @vili-1 ?

@afd afd added the modelling label Oct 19, 2022
@afd afd transferred this issue from another repository Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants