Skip to content

spirv-fuzz: Transformation to replace an id of an OpPhi instruction with the corresponding operands of the OpPhi instruction #3458

@Vasniktel

Description

@Vasniktel

Overview

OpPhi instruction is used to select some result id based on the previous basic block that was executed. We can replace the use of an OpPhi instruction’s result id with the corresponding operand of the OpPhi instruction. This transformation can provide an opportunity for the previous transformation to move the instruction between basic blocks.

Implementation

The implementation of this transformation should follow the domination rules of the SPIR-V language. Particularly, if the instruction of interest uses a result id of some instruction from the same basic block that is not an OpPhi, we cannot apply this transformation to that instruction. Otherwise, we will have to insert a copy of this instruction into every preceding basic block, adjust operands to all those inserted instructions s.t. the result id of every OpPhi instruction is replaced with the corresponding operand to that instruction and replace the initial instruction with the OpPhi.

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