Skip to content

spirv-fuzz: Bad interaction between FlattenConditionalBranch and synonym facts #4024

@afd

Description

@afd

Suppose we have some code like this:

x = ...;
if (c) {
  y = x;
}
// (*)

We get a synonym fact between x and y meaning they are guaranteed to be equivalent whenever they are both available. Importantly they are not synonymous at (*) because y is not available there.

Currently if a conditional branch gets flattened we have the problem where the above turns into:

x = ...;
y = c ? x : arbitrary;
// (*)

We evidently cannot regard x and y as being synonymous now.

Perhaps FlattenConditionalBranch should be inapplicable if any instruction in the region being flattened generates an id that is involved in a synonym or equation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions