Skip to content

spirv-fuzz: Transformation to swap operands in OpBranchConditional instruction #3416

@Vasniktel

Description

@Vasniktel

Overview

OpBranchConditional instruction is used to decide which basic block will be executed next based on the boolean value (i.e. true or false). This transformation will swap the operands to this instruction as well as invert the logical value that determines the execution.

Implementation

The implementation is similar to #3415. Additionally, we have to introduce an OpLogicalNot to flip the condition operand. We can also flip the weights if they are specified. We should also be careful about position-dependent instructions (e.g. OpLoopMerge, OpSelectionMerge) when inserting OpLogicalNot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions