Commit Graph

324 Commits

Author SHA1 Message Date
Ben Clayton
7403dfafd8
CMake: Add SPIRV_TOOLS_BUILD_STATIC flag (#3910)
If enabled the following targets will be created:

* `${SPIRV_TOOLS}-static` - `STATIC` library. Has full public symbol visibility.
* `${SPIRV_TOOLS}-shared` - `SHARED` library. Has default-hidden symbol visibility.
* `${SPIRV_TOOLS}`        - will alias to one of above, based on BUILD_SHARED_LIBS.

If disabled the following targets will be created:

* `${SPIRV_TOOLS}`        - either `STATIC` or `SHARED` based on the new `SPIRV_TOOLS_LIBRARY_TYPE` flag. Has full public symbol visibility.
* `${SPIRV_TOOLS}-shared` - `SHARED` library. Has default-hidden symbol visibility.

Defaults to `ON`, matching existing build behavior.

This flag can be used by package maintainers to ensure that all libraries are built as shared objects.
2020-10-29 09:25:26 -04:00
André Perez
abe2eff36f
spirv-fuzz: Add expand vector reduction transformation (#3869)
The following implementations are introduced:

- Transformation and fuzzer pass for expanding vector reduction.
- Unit tests to cover the instructions with different vector sizes.

Fixes #3768.
2020-10-23 14:59:08 +01:00
Vasyl Teliman
99ad4f1e29
spirv-fuzz: Don't replace irrelevant indices in OpAccessChain (#3988)
Part of #3980.
2020-10-23 14:52:22 +01:00
Vasyl Teliman
895dafcc1d
spirv-fuzz: Add FuzzerPassAddCompositeExtract (#3904)
Fixes #3806.
2020-10-23 14:49:50 +01:00
Alastair Donaldson
69f07da41b
spirv-fuzz: Fix mismatch with shrinker step limit (#3985)
Fixes #3984.
2020-10-22 23:23:59 +01:00
Alastair Donaldson
9223493f4d
spirv-fuzz: Fix off-by-one error in replayer (#3982)
Fixes #3981.
2020-10-22 20:07:09 +01:00
Alastair Donaldson
4f5423187d
spirv-fuzz: Get order right for OpSelect arguments (#3974)
Fixes #3948.
2020-10-22 16:05:51 +01:00
Alastair Donaldson
88f7bcb6af
spirv-fuzz: Do not add synonym-creating loops in dead blocks (#3975)
Fixes #3954.
2020-10-22 12:07:49 +01:00
Alastair Donaldson
64eaa9832f
spirv-fuzz: Skip OpTypeSampledImage when propagating up (#3976)
Fixes #3959.
2020-10-22 12:07:17 +01:00
Alastair Donaldson
53f2a69c19
spirv-fuzz: Pass OpUndef in function call if needed (#3978)
Fixes #3977.
2020-10-22 12:06:54 +01:00
Alastair Donaldson
de2c0ba202
spirv-fuzz: Fix off-by-one in TransformationCompositeConstruct (#3979) 2020-10-22 12:06:37 +01:00
Alastair Donaldson
dc4a182282
spirv-fuzz: Tolerate absent ids in data synonym fact management (#3966)
Fixes #3952.
2020-10-22 00:06:53 +01:00
Alastair Donaldson
8496780f57
spirv-fuzz: Fix to id availability (#3971)
Fixes #3958.
2020-10-21 22:52:47 +01:00
Alastair Donaldson
3b7aebca45
spirv-fuzz: Fix operand types (#3962)
Fixes #3945.
Fixes #3946.
2020-10-21 22:41:30 +01:00
Alastair Donaldson
a8d7062fe5
spirv-fuzz: Don't flatten conditional if condition is irrelevant (#3944)
Fixes #3942.
2020-10-21 21:26:59 +01:00
Alastair Donaldson
a3d5378df6
spirv-fuzz: Do not produce OpPhis of type OpTypeSampledImage (#3964)
Also removes some redundant validity checks in tests.

Fixes #3950.
2020-10-21 21:12:19 +01:00
Alastair Donaldson
7edd0525b9
spirv-fuzz: Restrict fuzzer pass to reachable blocks (#3970) 2020-10-21 20:52:58 +01:00
Alastair Donaldson
f03779a1a1
spirv-fuzz: Handle more types when extending OpPhi instructions (#3969)
Fixes #3953.
2020-10-21 20:52:36 +01:00
Alastair Donaldson
c794b70461
spirv-fuzz: Skip early terminator wrappers when merging returns (#3968)
Fixes #3955.
2020-10-21 20:51:10 +01:00
Alastair Donaldson
dc9c6407d6
spirv-fuzz: Avoid irrelevant constants in synonym-creating loops (#3967)
Fixes #3956.
2020-10-21 20:50:45 +01:00
Alastair Donaldson
26954c281e
spirv-fuzz: Skip dead blocks in FuzzerPassAddOpPhiSynonyms (#3965)
Fixes #3949.
2020-10-21 20:49:33 +01:00
Alastair Donaldson
5600fb85b6
spirv-fuzz: Avoid the type manager when looking for struct types (#3963)
Fixes #3947.
2020-10-21 18:28:05 +01:00
Alastair Donaldson
ba15b58862
spirv-fuzz: Fix to TransformationDuplicateRegionWithSelection (#3941)
Also incorporates a few style fixes.

Fixes #3940.
2020-10-20 18:59:53 +01:00
Alastair Donaldson
5984350044
spirv-fuzz: Skip OpFunction when replacing irrelevant ids (#3932)
Fixes #3927.
2020-10-20 18:58:42 +01:00
Alastair Donaldson
8362eae552
spirv-fuzz: Use component-wise selectors when flattening conditional branches (#3921)
Fixes #3920.
2020-10-20 18:57:56 +01:00
Alastair Donaldson
b1350659b6
spirv-fuzz: Avoid void struct member when outlining functions (#3936)
Fixes #3935.
2020-10-19 17:34:31 +01:00
Alastair Donaldson
fd0f295da6
spirv-fuzz: Do not allow Block-decorated structs when adding parameters (#3931)
Fixes #3929.
2020-10-19 17:34:04 +01:00
Alastair Donaldson
5d7893b376
spirv-fuzz: Fix to operand id type (#3937)
Fixes #3934.
2020-10-19 17:33:25 +01:00
Alastair Donaldson
cd1d3b6e0c
spirv-fuzz: Handle dead blocks in TransformationEquationInstruction (#3933)
Fixes #3926.
2020-10-19 17:32:56 +01:00
Alastair Donaldson
6cdae9da72
spirv-fuzz: Do not allow sampled image load when flattening conditionals (#3930)
Fixes #3928.
2020-10-19 17:32:26 +01:00
Alastair Donaldson
7e1825a596
spirv-fuzz: Take care of OpPhi instructions when inlining (#3939)
Fixes #3938.
2020-10-19 09:41:01 +01:00
Alastair Donaldson
502e982956
spirv-fuzz: Fix to TransformationInlineFunction (#3913)
This fixes a problem where TransformationInlineFunction could lead to
distinct instructions having identical unique ids. It adds a validity
check to detect this problem in general.

Fixes #3911.
2020-10-16 22:58:09 +01:00
Alastair Donaldson
bf1a11dab7
spirv-fuzz: Wrap early terminators before merging returns (#3925)
Incorporates some other fixes for issues that were brought to light by
adding this functionality.

Fixes #3717.
Fixes #3924.
2020-10-16 19:29:39 +01:00
Alastair Donaldson
dd534e877e
spirv-fuzz: Lower probability of adding bit instruction synonyms (#3917)
Fixes #3914.
2020-10-15 15:20:05 +01:00
Alastair Donaldson
53aeba10cd
spirv-fuzz: Fix handling of OpPhi in FlattenConditionalBranch (#3916)
Fixes #3915.
2020-10-15 14:41:23 +01:00
Alastair Donaldson
5c64374dd6
spirv-fuzz: Avoid creating blocks without parents (#3908)
The validity check during fuzzing and in unit tests is strengthened to
require that every block has its enclosing function as its parent.
TransformationMergeFunctionReturns is fixed so that it ensures parents
are set appropriately.

Fixes #3907.
2020-10-13 19:48:18 +01:00
Alastair Donaldson
57b3723c5c
spirv-fuzz: Do not allow creation of constants of block-decorated structs (#3903)
Fixes #3902.
2020-10-13 18:35:41 +01:00
Alastair Donaldson
12ca825a60
spirv-fuzz: Fixes related to irrelevant ids (#3901)
Fixes #3899.
Fixes #3900.
2020-10-13 18:01:42 +01:00
Alastair Donaldson
2e6cf706ee
spirv-fuzz: Fix to transformation that adds a synonym via a loop (#3898)
Fixes #3897.
2020-10-13 14:26:47 +01:00
Alastair Donaldson
4b884928db
spirv-fuzz: Fix to duplicate region with selection (#3896)
Fixes #3895.
2020-10-13 14:25:43 +01:00
Alastair Donaldson
c2553a315f
spirv-fuzz: Do not expose synonym facts for non-existent ids (#3891)
Fixes #3888.
2020-10-09 07:18:46 +01:00
Alastair Donaldson
3602287858
spirv-fuzz: Do not add synonyms involving irrelevant ids (#3890)
Fixes #3886.
2020-10-08 22:34:39 +01:00
Alastair Donaldson
d52f79122a
spirv-fuzz: Do not replace irrelevant ids that are not in blocks (#3892)
Fixes #3889.
2020-10-08 22:33:46 +01:00
Alastair Donaldson
e022659922
spirv-fuzz: Wrap OpKill and similar in function calls (#3884)
Part of #3717.
2020-10-08 22:33:14 +01:00
Alastair Donaldson
fc8264854c
spirv-fuzz: Replace dead-block terminators with OpKill etc. (#3882)
Fixes #3615.
2020-10-06 15:59:05 +01:00
Vasyl Teliman
63cc22d645
spirv-fuzz: TransformationPropagateInstructionDown (#3692)
Fixes #3691.
2020-10-06 13:38:19 +01:00
Alastair Donaldson
65b2a9e814
spirv-fuzz: Transformation to add wrappers for OpKill and similar (#3881)
Part of #3717.
2020-10-06 12:07:56 +01:00
Alastair Donaldson
624b16cd0c
spirv-fuzz: Use overflow ids when duplicating regions (#3878)
Fixes #3786.
2020-10-06 12:07:20 +01:00
Vasyl Teliman
bd0dd9cef1
spirv-fuzz: Fix rvalue references (#3883)
Fixes #3659.
2020-10-06 12:06:53 +01:00
Alastair Donaldson
f151337880
spirv-fuzz: Avoid using block-decorated structs in transformations (#3877)
Fixes #3875.
2020-10-02 20:01:08 +01:00