Commit Graph

155 Commits

Author SHA1 Message Date
André Perez
3622769785
spirv-fuzz: Fix instruction insertion issue (#3521)
Fixes #3520.
2020-07-14 17:45:52 +01:00
André Perez
91d921e892
spirv-fuzz: Implement the OpMatrixTimesMatrix linear algebra case (#3527)
This PR implements the OpMatrixTimesMatrix case for the
replace linear algebra instruction transformation.
2020-07-14 17:20:09 +01:00
André Perez
c9b254d045
spirv-fuzz: Support adding dead break from back-edge block (#3519)
Fixes #2577.
2020-07-14 12:32:16 +01:00
André Perez
fe4dca5166
Support OpPhi when replacing boolean constant operand (#3518)
Fixes #2902.
2020-07-14 10:27:15 +01:00
Vasyl Teliman
40c3c1cace
spirv-fuzz: TransformationAddSynonyms (#3447)
Part of #3440.
2020-07-12 09:59:08 +01:00
Vasyl Teliman
13dc28ce71
spirv-fuzz: Remove unused functions (#3510) 2020-07-11 08:57:07 +01:00
Vasyl Teliman
282962362f
spirv-fuzz: Minor refactoring (#3507) 2020-07-11 07:43:06 +01:00
Stefano Milizia
5f8cdd8b45
Implement transformation to record synonymous constants. (#3494)
Adds a fact-only transformation that records that two constants in the module are synonymous.
2020-07-10 14:02:14 +01:00
Vasyl Teliman
de56c34bd6
spirv-fuzz: TransformationReplaceParameterWithGlobal (#3434)
Fixes #3432.
2020-07-09 11:03:49 +01:00
André Perez
11946e640c
Implement the OpMatrixTimesVector linear algebra case (#3500)
This PR implements the OpMatrixTimesVector case for the
replace linear algebra instruction transformation.
2020-07-09 08:56:08 +01:00
André Perez
daa3b47ed4
spirv-fuzz: Add image sample unused components transformation (#3439)
Fixes #3375.
2020-07-08 17:07:04 +01:00
André Perez
7afbc0c8be
spirv-fuzz: Add variables with workgroup storage class (#3485)
Fixes #3274.
2020-07-07 23:46:47 +01:00
André Perez
2fbeb04b6e
spirv-fuzz: Implement the OpVectorTimesMatrix linear algebra case (#3489)
This PR implements the OpVectorTimesMatrix case for the
replace linear algebra instruction transformation.
2020-07-07 14:29:48 +01:00
Vasyl Teliman
6d61c1159e
spirv-fuzz: fuzzerutil::MaybeGetConstant* #3487
Part of #3428.
2020-07-07 10:46:04 +01:00
Vasyl Teliman
bd2a9ea852
spirv-fuzz: TransformationInvertComparisonOperator (#3475)
Part of #3440.
2020-07-03 17:37:32 +01:00
Vasyl Teliman
2c1ff230c2
Fix regression (#3481)
Fixes #3480.
2020-07-02 10:51:10 +01:00
Vasyl Teliman
4a92579a45
spirv-fuzz: Add fuzzerutil::FindOrCreate* (#3479)
Part of #3428.
2020-07-02 10:46:49 +01:00
Vasyl Teliman
fba90d6b0a
spirv-fuzz: Add FuzzerPassAddCopyMemoryInstructions (#3391)
Fixes #3382.
2020-06-30 21:13:05 +01:00
Vasyl Teliman
ab10489a02
spirv-fuzz: Add one parameter at a time (#3469)
Fixes #3467.
Fixes #3468.
2020-06-30 15:20:27 +01:00
André Perez
c3680adbd5
Implement the OpMatrixTimesScalar linear algebra case (#3450)
This PR implements the OpMatrixTimesScalar case for the
replace linear algebra instruction transformation.
2020-06-26 15:54:33 +01:00
Vasyl Teliman
29ba53f2a2
spirv-fuzz: Implement FuzzerPassAddParameters (#3399)
Fixes #3384.
2020-06-23 17:40:44 +01:00
Vasyl Teliman
71a5b6770d
spirv-fuzz: Add GetParameters (#3454)
Adds a GetParameters function to fuzzerutil.
2020-06-23 16:41:45 +01:00
Vasyl Teliman
8e586e46a2
spirv-fuzz: Permute OpPhi instruction operands (#3421)
Fixes #3415.
2020-06-23 15:00:28 +01:00
Vasyl Teliman
33cf7c425a
spirv-fuzz: Refactor variable creation (#3414)
Fixes #3413.
2020-06-19 16:40:18 +01:00
Vasyl Teliman
d5306c8e8f
spirv-fuzz: Swap operands in OpBranchConditional (#3423)
Fixes #3415.
2020-06-19 16:38:52 +01:00
André Perez
9494703546
spirv-fuzz: Implement vector shuffle fuzzer pass (#3412)
Fixes #3108.
2020-06-16 11:21:31 +01:00
André Perez
12a4fb3bc1
spirv-fuzz: Add replace linear algebra instruction transformation (#3402)
This PR implements a transformation that replaces
a linear algebra instruction with its mathematical definition.
2020-06-16 11:20:51 +01:00
Vasyl Teliman
30bf46dbe0
Fix operand access (#3427)
Fixes #3426.
2020-06-13 00:03:25 +01:00
Vasyl Teliman
c01f826bc6
spirv-fuzz: Add support for OpSpecConstant* (#3373)
Fixes #3371.
2020-06-10 01:01:15 +01:00
Vasyl Teliman
7c213720bb
spirv-fuzz: Fix replayer bug (#3401)
Fixes #3395.
2020-06-05 14:34:39 +01:00
André Perez
9ed0fef6e1
Add value instruction condition (#3385)
This change fixes an assertion failure related to the push
id through variable transformation. In the fuzzer pass class
it was missing the IdIsAvailableBeforeInstruction condition
that is checked in the IsApplicable function.
2020-06-05 12:30:51 +01:00
André Perez
ffaecad326
Fix instruction function use (#3390)
This change replaces the instruction function GetSingleWordOperand
with GetSingleWordInOperand. Debugging spirv-fuzz, GetSingleWordOperand
was returning the result id of an OpLoad instruction with memory operands.
2020-06-05 12:29:23 +01:00
Vasyl Teliman
94808bd0f0
spirv-fuzz: Fix regression (#3396)
Fixes #3392.
2020-06-05 12:28:07 +01:00
André Perez
f050cca7ec
spirv-fuzz: Add push id through variable transformation (#3359)
Makes an id synonym by storing an id to a new variable and then
loading it back from that variable.

Fixes #3192.
2020-05-29 16:43:38 +01:00
André Perez
d3d89bb90c
spirv-fuzz: Support bit width argument for int and float types (#3378)
This change add support to pass bit width of integer and float types
as argument when creating floating-point and integer types and
constants.
2020-05-26 15:59:11 +01:00
André Perez
55af3902fc
Fix function use (#3372)
This PR fixes a function use of a Instruction object.
2020-05-26 12:28:02 +01:00
Vasyl Teliman
2f69ea849a
spirv-fuzz: Remove FuzzerPassAddUsefulConstructs (#3341)
Fixes #3318.
2020-05-19 15:54:55 +01:00
Vasyl Teliman
522561619a
Add support for StorageBuffer (#3348)
Fixes #3347.
2020-05-19 15:54:05 +01:00
André Perez
a6b0e132ec
Add adjust branch weights transformation (#3336)
In this PR, the classes that represent the adjust branch weights
transformation and fuzzer pass were implemented. This transformation
adjusts the branch weights of a OpBranchConditional instruction.
2020-05-14 11:38:34 +01:00
Alastair Donaldson
a9f2a145e6
spirv-fuzz: Fix to fact manager (#3339)
Reworks the way uniforms with known constants are queried to avoid
unintended side effects to the constant manager.

Fixes #3338.
2020-05-13 22:04:52 +01:00
Alastair Donaldson
045a26e6e3
spirv-fuzz: Get rid of unnecessary template method (#3340)
A template method turned out not to be necessary.
2020-05-13 22:04:24 +01:00
Alastair Donaldson
2e1d208ed9
spirv-fuzz: Do not allow adding stores to read-only pointers (#3316)
Re-uses IsReadOnlyPointer functionality for the optimizer to make the check
that avoids storing through read-only pointers more thorough.
2020-05-01 02:50:44 +01:00
Alastair Donaldson
f278b467df
spirv-fuzz: Do not outline regions that end with a loop header (#3312)
The outliner would outline regions ending with a loop header, making
the block containing the call to the outlined function serve as the
loop header.  This, however, is incorrect in general, since the whole
outlined function -- rather than just the exit block for the region --
would end up getting called every time the loop would iterate.

This change restricts the outliner so that the last block in a region
cannot be a loop header.
2020-04-28 13:32:06 +01:00
Alastair Donaldson
94d6002dc5
spirv-fuzz: Pass on validator options during shrinking (#3317)
Fixes an issue where the shrinker's validator options were not
actually being passed to the validator.
2020-04-27 14:25:46 +01:00
Alastair Donaldson
88faf63ad3
spirv-fuzz: Clamp statically out-of-bounds accesses in code donation (#3315)
It has been resolved that statically out-of-bounds accesses are not
invalid in SPIR-V (they lead to undefind behaviour at runtime but
should not cause a module to be rejected during validation).  This
change tolerates such accesses in donated code, clamping them in-bound
as part of making a function live-safe.
2020-04-27 14:24:54 +01:00
Alastair Donaldson
b74199a22d
spirv-fuzz: Fix memory management in the fact manager (#3313)
Fixes a bug where, while recursively adding id equation facts, a
reference to a set of id equations could be used after it had been
freed (due to equivalence classes of equations being merged).
2020-04-27 14:24:11 +01:00
Alastair Donaldson
d158ffe540
spirv-fuzz: Do not replace the Sample argument in OpImageTexelPointer (#3311)
The Sample argument of OpImageTexelPointer is sometimes required to be
a zero constant.  It thus cannot be replaced with a synonym in
general.  This change avoids replacing this argument with a synonym.
2020-04-27 14:23:11 +01:00
Alastair Donaldson
67f4838659
spirv-fuzz: Make handling of synonym facts more efficient (#3301)
The fact manager maintains an equivalence relation on data descriptors
that tracks when one data descriptor could be used in place of
another.  An algorithm to compute the closure of such facts allows
deducing new synonym facts from existing facts.  E.g., for two 2D
vectors u and v it is known that u.x is synonymous with v.x and u.y is
synonymous with v.y, it can be deduced that u and v are synonymous.

The closure computation algorithm is very expensive if we get large
equivalence relations.

This change addresses this in three ways:

- The size of equivalence relations is reduced by limiting the extent
  to which the components of a composite are recursively noted as
  being equivalent, so that when we have large synonymous arrays we do
  not record all array elements as being pairwise equivalent.

- When computing the closure of facts, equivalence classes above a
  certain size are simply skipped (which can lead to missed facts)

- The closure computation is performed less frequently - it is invoked
  explicitly before fuzzer passes that will benefit from data synonym
  facts.  A new transformation is used to control its invocation, so
  that fuzzing and replaying do not get out of sync.

The change also tidies up the order in which some getters are declared
in FuzzerContext.
2020-04-20 19:02:49 +01:00
Alastair Donaldson
ed96301c6c
spirv-fuzz: Fix to outliner (#3302)
Adds an extra condition on when a region can be outlined to avoid the
case where a region ends with a loop head but such that the loop's
continue target is in the region.  (Outlining such a region would mean
that the loop merge is in the original function and the continue target
in the outlined function.)
2020-04-15 11:39:33 +01:00
Alastair Donaldson
c018fc6ae6
spirv-fuzz: Do not outline regions that produce pointer outputs (#3291)
The function outliner uses a struct to return ids that a region
generates and that are used outside that region.  If these ids have
pointer type this would result in a struct with pointer members, which
leads to illegal loading from non-logical pointers if logical
addressing is used.  This change bans that outlining possibility.
2020-04-14 20:22:30 +01:00