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

spirv-fuzz: Duplicate region using selection construct #3614

Closed
afd opened this issue Jul 29, 2020 · 3 comments · Fixed by #3773
Closed

spirv-fuzz: Duplicate region using selection construct #3614

afd opened this issue Jul 29, 2020 · 3 comments · Fixed by #3773
Assignees
Labels
component:fuzzer Relates to the spirv-fuzz tool

Comments

@afd
Copy link
Contributor

afd commented Jul 29, 2020

Given a region R, this transformation will essentially turn R into:

if (...) {
  R;
} else {
  duplicate_of_R;
}

or alternatively to:

switch(...) {
case ...:
   R;
   break;
default:
   duplicate_of_R;
   break;

In both cases the value of the boolean guard or integer switch selector does not matter given that the branches are semantically equivalent.

The code after the duplicated region will need to use an OpPhi to capture ids generated by R and used after R.

@afd
Copy link
Contributor Author

afd commented Jul 29, 2020

@paulthomson for info.

@afd afd added the component:fuzzer Relates to the spirv-fuzz tool label Jul 29, 2020
@paulthomson
Copy link
Contributor

@antnkarp I think this might be a good one for you to take.

@antonikarp
Copy link
Collaborator

Great, I can implement this.

@afd afd closed this as completed in #3773 Sep 11, 2020
afd pushed a commit that referenced this issue Sep 11, 2020
Adds a transformation that inserts a conditional statement with a
boolean expression of arbitrary value and duplicates a given
single-entry, single-exit region, so that it is present in each
conditional branch and will be executed regardless of which branch will
be taken.

Fixes #3614.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:fuzzer Relates to the spirv-fuzz tool
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants