Skip to content

spirv-fuzz: Transformation to replace a subset of function parameters with a struct value #3453

@Vasniktel

Description

@Vasniktel

Implementation

In the fuzzer pass, we need to randomly decide for each function a set of parameters that we want to replace. We also need to make sure that the required struct and function types exist in the module.
In the transformation class, we need to replace a type of function with a new one. We also need to replace OpFunctionParameter instructions with OpVariable instructions with Function storage class for the parameters that are being replaced, introduce an additional OpFunctionParameter instruction for a struct parameter and introduce OpAccessChain instructions to initialize new variables. Apart from that, we also need to adjust every call site of the function. If the parameter’s type is an OpTypePointer, store the pointee into a struct field and restore it back after the function call. If the parameter is not a pointer (clspv compiler produces such code), simply store the value in the struct.

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