Skip to content

spirv-fuzz: Replace OpCopyObject with the pair OpStore and OpLoad instructions #3351

@andreperezmaselco

Description

@andreperezmaselco

If we have %8 = OpCopyObject %type %7, we could create a new variable with type pointer to %type, store %7 to the new variable and load the new variable to %8. The following is an example.

OpStore %fresh_variable_id %7
%8 = OpLoad %type %fresh_variable_id

This transformation protobuf would consist of copy_object_result_id, fresh_variable_id, variable_storage_class, variable_initializer_id.

The transformation is only applicable if the pointer type already exists. The pointer type cannot be a pointer to a pointer.

The fuzzer pass would look for OpCopyObject instructions and create and apply a transformation to add the required pointer type, if needed using FindOrCreatePointerType.

The transformation should add a synonym fact to the fact manager.

This will be similar to TransformationPushIdThroughVariable.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions