Commit Graph

4 Commits

Author SHA1 Message Date
Stefano Milizia
c10d6cebbc
spirv-fuzz: refactor to use RemoveAtRandomIndex (#3560)
Make the code in fuzzer_pass_merge_blocks.cpp simpler by
using the RemoveAtRandomIndex function from FuzzerContext.

See related comment in #3540
2020-07-20 16:10:38 +01:00
Stefano Milizia
7dfd9b8680
spirv-fuzz: Implement MaybeApplyTransformation helper function (#3540)
This function can be used to apply a transformation only if it is
applicable and use it wherever this pattern is used.

Fixes #3530.
2020-07-17 13:01:35 +01:00
Alastair Donaldson
8d4261bc44
spirv-fuzz: Introduce TransformationContext (#3272)
Some transformations (e.g. TransformationAddFunction) rely on running
the validator to decide whether the transformation is applicable.  A
recent change allowed spirv-fuzz to take validator options, to cater
for the case where a module should be considered valid under
particular conditions.  However, validation during the checking of
transformations had no access to these validator options.

This change introduced TransformationContext, which currently consists
of a fact manager and a set of validator options, but could in the
future have other fields corresponding to other objects that it is
useful to have access to when applying transformations.  Now, instead
of checking and applying transformations in the context of a
FactManager, a TransformationContext is used.  This gives access to
the fact manager as before, and also access to the validator options
when they are needed.
2020-04-02 15:54:46 +01:00
Alastair Donaldson
96354f5047
spirv-fuzz: Fuzzer pass to merge blocks (#3097)
This change adds a transformation and associated fuzzer pass for
merging adjacent blocks in a module, re-using block merging code from
the optimizer.
2019-12-12 15:27:40 +00:00