Commit Graph

3016 Commits

Author SHA1 Message Date
Shahbaz Youssefi
ae6a1e1d2f
Fix UWP build (#4235)
UWP doesn't support system(), so skip building spirv-reduce on it
similarly to iOS.
2021-04-12 13:17:44 -04:00
Paul Thomson
6210375e13
Fix clang-format-diff.py URL (#4233)
Also add the --fail flag so that kokoro/check-format/build.sh fails when it cannot download the clang-format-diff.py script.
2021-04-09 23:36:36 +01:00
Alastair Donaldson
8da800c4cb
spirv-reduce: Remove redundant r-value references (#4232) 2021-04-09 13:55:51 +01:00
Alastair Donaldson
212895d4c2
Typo fix (#4225) 2021-04-02 09:59:35 +01:00
Greg Fischer
48007a5c7f
Add interpolate legalization pass (#4220)
This pass converts an internal form of GLSLstd450 Interpolate ops
to the externally valid form. The external form takes the lvalue
of the interpolant. The internal form can do a load of the interpolant.
The pass replaces the load with its pointer. The internal form is
generated by glslang and possibly other frontends for HLSL shaders.
The new pass is called as part of HLSL legalization after all
propagation is complete.

Also adds internal interpolate form to pre-legalization validation
2021-03-31 14:26:36 -04:00
Alastair Donaldson
61e256c9c4
spirv-fuzz: Efficiency improvements to fuzzer pass (#4188)
FuzzerPassConstructComposites is adapted to use AvailableInstructions
to manage available instructions, and to use zero constants when
trying to construct a composite for which not all fields can otherwise
be constructed. The change uncovered some cases where we create
structs and arrays with struct fields or components that are
block-decorated; these possibilities have been eliminated.
2021-03-27 12:15:59 +00:00
Alastair Donaldson
2ee21fbdee
spirv-fuzz: Avoid invalidating analyses when splitting blocks (#4218)
It is easy to avoid the need to invalidate the def-use analysis and
instruction to block mapping when splitting blocks, and profiling has
revealed that invalidation of def-use in particular is expensive when
splitting many blocks. This change avoids these invalidations.
2021-03-27 12:13:23 +00:00
Alastair Donaldson
22eb528f17
spirv-fuzz: Do not add too many dead blocks (#4217)
Profiling has shown that adding large numbers of dead block
transformations can be expensive because each on requires dominator
analysis information, and each one invalidates this information. There
is currently no obvious mechanism for incrementally updating the
dominator analysis. This change restricts the number of these
transformations that a single fuzzer pass will apply, to restrict this
performance bottleneck.
2021-03-27 10:30:23 +00:00
Alastair Donaldson
d0c73fcee1
spirv-fuzz: Optimize transformations (#4216)
Avoids blanket invalidation of analyses in several transformations,
instead updating the def-use manager and instruction to block mapping.
2021-03-26 10:22:06 +00:00
Vasyl Teliman
f227930153
spirv-fuzz: Fix comments #4215
Related to #4214.
2021-03-25 17:20:45 +00:00
Jason Ekstrand
ecc840d30b
Add validation for SPV_EXT_shader_atomic_float_min_max (#4105)
* Add an "extra_defs" parameter to GenerateShaderCode in atomics_test

* Add validation for SPV_EXT_shader_atomic_float_min_max
2021-03-24 08:49:21 -04:00
David Neto
d20c9c2cf3
Make spirv-tools-build-version a common dependency (#4210)
Required to support latest Xcode

Fixes #4109
2021-03-23 16:55:56 -04:00
Alastair Donaldson
bed84792f9
spirv-fuzz: Call by value and move in transformations (#4208)
Adapts all transformation classes so that their protobuf message is
passed by value and then moved into the message_ field.
2021-03-23 13:31:44 +00:00
Alastair Donaldson
c0833ce620
spirv-fuzz: Remove destructors from FuzzerPass subclasses (#4209)
Subclasses of FuzzerPass no longer needlessly override the default
destructor of FuzzerPass.
2021-03-23 13:31:27 +00:00
Alastair Donaldson
3d39517961
spirv-fuzz: Improve transformation test oracles (#4207)
To help ensure that optimizations that do less cautious invalidation
of analyses are implemented correctly, this change adds checks to the
tests of various transformations to ensure that analyses such as
def-use are up to date.
2021-03-23 13:31:14 +00:00
Vasyl Teliman
edb8399b0f
spirv-fuzz: Add WGSL compatibility flag to context (#4193)
The new flags allows transformations and fuzzer passes to be enabled
and applied in a WGSL-compatible fashion.
2021-03-21 09:10:15 +00:00
Alastair Donaldson
6382cbb497
spirv-fuzz: Avoid invalidating analyses in various transformations (#4205)
Avoids invalidating all analyses in transformations that add
constants, OpUndef and global and local variables.
2021-03-20 22:48:02 +00:00
Alastair Donaldson
6578899781
spirv-fuzz: Manage available instructions efficiently (#4177)
Introduces a data structure for efficient management of available
instructions in the fuzzer.
2021-03-20 18:51:18 +00:00
Alastair Donaldson
75d7c14cfb
spirv-fuzz: Remove AddType methods from fuzzerutil (#4204)
Types should only be added to the module by spirv-fuzz via
transformations, so this change removes the AddType methods from
fuzzerutil, which were only called once each from the appropriate
transformation.

The transformations have been adapted so that they avoid redundantly
invalidating all analyses - they now update the def-use manager and
invalidate only the type manager.
2021-03-20 08:54:51 +00:00
sfricke-samsung
f2a19b0150
spirv-val: Refactor of atomic pass (#4200) 2021-03-19 09:23:02 -04:00
sfricke-samsung
8f421ced3e
spirv-val: Label VUID 04643 (#4202) 2021-03-19 09:02:48 -04:00
sfricke-samsung
2b0d16a059
spirv-val: Label VUID 04667 (#4201) 2021-03-19 08:57:36 -04:00
Alastair Donaldson
a732e4c03c
spirv-fuzz: Apply fuzzer pass before checking exit conditions (#4199)
Fixes #4198.
2021-03-19 05:32:54 +00:00
sfricke-samsung
a611be7782
spirv-val: Fix Int64Atomics check (#4192) 2021-03-18 10:50:16 -04:00
timvpGoogle
4f498774db
Roll deps (#4185)
* Roll external/googletest/ 3af06fe16..b7d472f12 (177 commits)

3af06fe166...b7d472f122

$ git log 3af06fe16..b7d472f12 --date=short --no-merges --format='%ad %ae %s'
2021-03-11 absl-team Googletest export
2021-03-11 absl-team Internal change
2021-03-10 absl-team Googletest export
2021-03-10 absl-team Googletest export
2021-03-09 absl-team Googletest export
2021-03-09 absl-team Googletest export
2021-03-08 absl-team Googletest export
2021-03-08 absl-team Googletest export
2021-03-05 absl-team Internal change
2021-03-04 absl-team Googletest export
2021-03-04 absl-team Googletest export
2021-03-02 absl-team Googletest export
2021-03-01 absl-team Googletest export
2021-02-25 absl-team Googletest export
2021-02-22 absl-team Googletest export
2021-02-25 be remove -Zi from MSVC compiler options
2020-12-24 N.Dekker overload PrintTo for std::type_info and std::type_index
2021-02-19 absl-team Googletest export
2021-02-18 absl-team Googletest export
2021-02-17 absl-team Googletest export
2021-02-17 absl-team Googletest export
2021-02-16 absl-team Googletest export
2021-02-12 absl-team Googletest export
2021-02-11 absl-team Googletest export
2021-02-11 absl-team Googletest export
2021-02-11 absl-team Googletest export
2021-02-10 absl-team Googletest export
2021-02-10 absl-team Googletest export
2021-02-10 absl-team Googletest export
2021-02-09 absl-team Googletest export
2021-02-09 absl-team Internal change
2021-02-09 absl-team Googletest export
2021-02-08 absl-team Googletest export
2021-02-05 absl-team Googletest export
2021-02-05 platisd Do not include void into mocked method arguments
2021-02-04 absl-team Googletest export
2021-02-03 dmauro Googletest export
2021-02-03 absl-team Googletest export
2021-02-02 absl-team Googletest export
2021-02-02 absl-team Googletest export
2021-02-02 absl-team Googletest export
2021-02-02 dmcardle Googletest export
2021-02-02 absl-team Googletest export
2021-02-01 absl-team Googletest export
2021-01-27 absl-team Googletest export
2021-01-27 absl-team Googletest export
2021-01-26 absl-team Googletest export
2021-01-26 absl-team Googletest export
2021-01-25 absl-team Googletest export
2021-01-25 absl-team Googletest export
(...)
2020-10-09 ofats Googletest export
2020-10-09 absl-team Googletest export
2020-10-08 absl-team Googletest export
2020-10-12 peternewman Fix a typo
2020-10-07 manavrion Improve FilePath::Normalize method
2020-10-07 pravin1992 Issue 2135: Change template args in NiceMock, NaggyMock and StrictMock from A1, A2, ... to TArg1, TArg2,... to avoid clash with legacy header files
2020-09-29 absl-team Googletest export
2020-10-01 63450189+ranodeepbanerjee A slight Gramatical change.
2020-09-29 dmauro Googletest export
2020-09-29 absl-team Googletest export
2020-09-25 absl-team Googletest export
2020-09-27 56075233+keshavgbpecdelhi Update cook_book.md
2020-09-23 absl-team Googletest export
2020-09-23 absl-team Googletest export
2020-09-21 absl-team Googletest export
2020-09-24 thomas.barbier Fix warning maybe-uninitialized
2020-09-18 absl-team Googletest export
2020-09-17 absl-team Googletest export
2020-09-18 63900998+JethroSama Update README.md, added missing 'a'
2020-09-16 hyuk.myeong Remove spaces between Google Test and Google Mock
2020-09-15 hyuk.myeong Add follow-up patch for more natural reading
2020-09-15 hyuk.myeong Apply the reviewed comment
2020-09-15 hyuk.myeong Remove a space
2020-09-15 hyuk.myeong Improve the tutorial that may be confusing
2020-09-08 absl-team Googletest export
2020-09-02 dmauro Googletest export
2020-09-01 absl-team Googletest export
2020-09-01 absl-team Googletest export
2020-08-26 absl-team Googletest export
2020-08-25 27jf Add timestamp to in old method mock macro guide
2020-08-20 absl-team Googletest export
2020-08-17 absl-team Googletest export
2020-08-12 krzysio Googletest export
2020-08-12 robert.earhart Export LICENSE
2020-08-11 absl-team Googletest export
2020-08-11 dmauro Googletest export
2020-08-10 absl-team Googletest export
2020-08-03 amatanhead Remove ThrowsMessageHasSubstr and fix some nits after review
2020-07-13 amatanhead Cleanup a bulky expression, document implementation details
2020-07-07 amatanhead Fix build under msvc
2020-07-07 amatanhead Update tests after changing an error message
2020-07-07 amatanhead Fix build under msvc
2020-07-07 amatanhead Add a test to ensure that the `Throws` matcher only invokes its argument once.
2020-07-07 amatanhead Add a test for duplicate catch clauses in throw matchers, fix a couple of nitpicks.
2020-07-03 amatanhead Add missing documentation piece
2020-06-20 amatanhead Small improvements: code style and property name
2020-06-20 amatanhead Add matchers for testing exception properties
2018-05-01 lantw44 Avoid using environ on FreeBSD
2020-02-17 krystian.kuzniarek remove a duplicated include
2020-05-05 igor.n.nazarenko Detect proto messages based on presense of DebugString.

Created with:
  roll-dep external/googletest

* Roll external/re2/ ca11026a0..f8e389f3a (38 commits)

ca11026a03...f8e389f3ac

$ git log ca11026a0..f8e389f3a --date=short --no-merges --format='%ad %ae %s'
2021-02-24 junyer Make it easier to swap in a scalable reader-writer mutex.
2021-02-21 junyer Address some `-Wmissing-field-initializers' warnings.
2021-02-07 junyer Mention the WebAssembly wrapper.
2021-02-02 junyer Make *Cached* benchmarks actually use cached objects.
2021-02-01 junyer Undo SONAME bump. CharClass isn't exposed.
2021-01-28 junyer Use `static_cast<>` instead of a C-style cast.
2021-01-26 junyer Address `-Wnull-dereference' warnings from GCC 10.x.
2021-01-14 dirk.reinbach use target_include_directories() instead of include_directories().
2020-12-30 junyer Make RequiredPrefixForAccel() "see through" capturing groups.
2020-12-29 junyer Correct the WINVER check for SRWLOCK.
2020-11-25 junyer Remove a double space from mksyntaxgo for Go folks.
2020-11-17 junyer Make benchmarks use substrings of a random text buffer.
2020-11-15 twpayne Add note about Go Unicode character classes
2020-10-26 junyer Fix symbol visibility and add test coverage.
2020-10-13 junyer Get the conditional right this time. Sigh.
2020-10-13 junyer Don't support ParseFrom() on MSVC. It can cause ICEs.
2020-10-09 junyer Ensure that RE2::Arg works even with overloaded ParseFrom().
2020-10-08 junyer Refactor the RE2::Arg templates for readability.
2020-10-07 junyer Rename namespace internal to namespace re2_internal.
2020-10-07 junyer Address `-Wunused-parameter' warnings.
2020-10-07 junyer Add missing #include. Mea culpa.
2020-10-07 junyer Rework RE2::Arg with templates instead of macros.
2020-10-06 junyer Write `typename' in templates rather than `class'.
2020-09-27 junyer Fix some indentation.
2020-09-27 junyer Set BAZELISK_GITHUB_TOKEN.
2020-09-25 junyer Point to the official Python wrapper.
2020-09-25 junyer Disable fail-fast in GitHub Actions.
2020-09-25 junyer Fix a template that will break with GCC 11.x.
2020-09-22 junyer Try to use the Clang packages instead.
2020-09-22 junyer Try to make the Clang containers work.
2020-09-22 junyer Configure a build matrix for Clang using containers.
2020-09-22 junyer Address `-Wclass-memaccess' warnings from GCC 10.x.
2020-09-22 junyer Configure a build matrix for GCC using containers.
2020-09-22 junyer Migrate from Kokoro to GitHub Actions for Bazel.
2020-09-22 junyer Migrate from Kokoro to GitHub Actions for CMake.
2020-09-22 junyer Remove Travis CI configuration.
2020-09-22 junyer Initial GitHub Actions CI configuration.
2020-09-22 junyer Improve the comments for RE2::FullMatch() et al.

Created with:
  roll-dep external/re2

* Roll external/spirv-headers/ faa570afb..bcf55210f (11 commits)

faa570afbc...bcf55210f1

$ git log faa570afb..bcf55210f --date=short --no-merges --format='%ad %ae %s'
2020-07-03 dneto Support SPV_KHR_expect_assume
2020-07-03 dneto Support SPV_KHR_linkonce_odr
2021-03-01 alanbaker Change operand name in OpReadClockKHR to match extension
2021-02-13 dmalyshau Add Naga as SPIR-V generation tool
2020-08-19 jason Add header changes for SPV_EXT_shader_atomic_float_min_max
2021-01-27 jason.ekstrand Re-run buildSpvHeaders to fix indentation
2021-01-19 dneto Header generator: Check enumerant ordering
2021-01-27 ben.ashbaugh add generated headers
2021-01-27 ben.ashbaugh add None as a possible value for DebugInfoFlags
2021-01-05 ben.ashbaugh add function control bitfield reservation section reserve bit 16 for an upcoming Intel extension
2020-11-05 orbea cmake: Install cmake files to CMAKE_INSTALL_DATADIR

Created with:
  roll-dep external/spirv-headers
2021-03-17 10:22:50 -04:00
sfricke-samsung
c040bd3ae5
spirv-val: Add Vulkan Execution Scope checks (#4183)
* spirv-val: Add Vulkan Execution Scope checks
2021-03-17 10:00:11 -04:00
Alastair Donaldson
8866fd7ae2
spirv-fuzz: Locate instructions more efficiently (#4189)
Avoids redundantly searching the whome module when locating an
instruction from its descriptor - instead, only the block containing
the instruction needs to be searched.
2021-03-17 09:28:57 +00:00
Alastair Donaldson
db2a706467
spirv-fuzz: Make adding equation instructions more efficient (#4190)
Avoids unnecessary invalidation of analyses.
2021-03-17 09:28:46 +00:00
Alastair Donaldson
e8ab7101f6
spirv-fuzz: Make PermutePhiOperands more efficient (#4191)
Amends def-use information rather than invalidating all analyses in
TransformationPermutePhiOperands.
2021-03-17 09:28:36 +00:00
Jaebaek Seo
79ab273f99
Accept OpImageTexelPointer user in scalar-replacement (#4187)
We have to conduct the scalar replacement for an aggregate with an image
type even when it has OpImageTexelPointer users.
2021-03-16 16:40:51 -04:00
sfricke-samsung
042eff73fe
spirv-val: Add Vulkan Invocation Sematics check (#4182) 2021-03-16 10:53:37 -04:00
sfricke-samsung
03f23106c6
spirv-val: Label VUID 04634 (#4181) 2021-03-16 10:53:27 -04:00
David Neto
4100477e76
Support SPV_KHR_linkonce_odr, SPV_KHR_expect_assume (#4161)
* SPV_KHR_linkonce_odr

Covers:
- Assembler
- Disassembler
- Validator

* Support SPV_KHR_expect_assume

Covers:
- assembler
- disassembler
- validation
2021-03-16 09:51:59 -04:00
Alastair Donaldson
478754c005
spirv-fuzz: Avoid invalidating analyses (#4176)
The performance of spirv-fuzz is sometimes poor due to analyses being
conservatively invalidated. This can lead to quadratic time algorithms
when a fuzzer pass applies O(N) transformations, and where every
transformation e.g. depends on def-use analysis and invalidates
def-use analysis (because building def-use analysis is O(N)).

This change avoids invalidating analyses for certain transformations.
2021-03-14 01:53:21 +00:00
Vasyl Teliman
7779907584
spirv-fuzz: Add buggy test (#4180)
Part of #4170.
2021-03-14 01:52:05 +00:00
Corentin Wallez
9e93b165c7
Remove usage of std::iterator. (#4171)
This helper class was deprecated in C++17 and some compilers start
warning about it. Replaces usages of std::iterator with manual type
aliases.
2021-03-12 14:00:56 +00:00
Corentin Wallez
5d8c40399e
BUILD.gn: fix typo for 'cflags' (#4169) 2021-03-11 10:08:33 +00:00
Corentin Wallez
77eb2b608e
Suppress warning (#4168)
* GN: Format BUILD.gn using 'gn format'

* GN: Suppress -Wformat-truncation on GCC for a Skia builder
2021-03-10 15:19:24 -05:00
Alastair Donaldson
f7cf3ec2a5
spirv-fuzz: Avoid unnecessary dependency (#4165)
The fuzzer library depended on CLIMessageConsumer, due to its explicit
use in a function. This change removes that dependency so that,
instead, a message consumer parameter is passed.
2021-03-10 15:37:14 +00:00
Daniel Koch
1746ed39d5
Add void in function declaration to keep some compilers happy (#4160)
fixes

error: function declaration isn't a prototype [-Werror=strict-prototypes]

Change-Id: I73dad8edbe82b5b481c6b87d773d6e6f8d191a45
2021-03-10 08:55:29 -05:00
Corentin Wallez
4a59fd4763
Fix -Wextra-semi-stmt -Wsuggest-destructor-override -Wdeprecated-copy-dtor (#4164)
* Fix -Wextra-semi-stmt
* Fix -Wsuggest-destructor-override
* Fix -Wdeprecated-copy-dtor
2021-03-09 13:16:43 +00:00
sfricke-samsung
c6da5e343c
spirv-val: Vulkan 64-bit OpAtomicStore check (#4163) 2021-03-08 14:34:06 -05:00
Vasyl Teliman
e6a9f4e430
spirv-fuzz: Fix the bug in TransformationReplaceBranchFromDeadBlockWithExit (#4140)
Fixes #4136.
2021-03-05 14:27:37 +00:00
Vasyl Teliman
7d514cf1c7
spirv-fuzz: Fix PartialCount (#4159)
Fixes #4158.
2021-03-05 11:13:28 +00:00
Alastair Donaldson
f7043c0de6
spirv-fuzz: Handle Vulkan SPIR-V versions (#4156)
Fixes #4155.
2021-03-03 22:29:57 +00:00
Vasyl Teliman
43cfa9bc1d
spirv-fuzz: Add persistent state to the fuzzer (#4137)
Adds persistent state to the fuzzer so that it can be used as a custom
mutator for mutation-based fuzzing.
2021-03-03 15:34:53 +00:00
alan-baker
939bc02603
Require an OpSelectionMerge before an OpSwitch (#4154)
Fixes #4153

* OpSwitch is required to be preceeded by OpSelectionMerge
* Update newly invalid tests
2021-03-02 15:40:56 -05:00
Steven Perron
0bd920eb9d
Use standard function to get stdin to binary mode. (#4141)
* Use standard function to get stdin to binary mode.

The fisrt implementation to try to change stdin to binary mode is not
protable.  Using freopen has a lot of implementation defined behaviour,
and the code relied on that working.

Looking into the MSVC documentation, I do not see a protable way of
doing this.  I've implemented a Windows specific method and do nothing
for other systems.  In general, UNIX based systems do make a distinction
between text and binary files, so nothing needs to be done for them.

Fixes #2518

* Split ReadFile into two different functions.

We want to remove the flag parameter.  So the original function has been
replaced with ReadBinaryFile and ReadTextFile.  This should make the
code more readable.

* Change name of CorrectlyReadFile to avoid confusion.
2021-03-01 09:38:49 -05:00
Ben Clayton
d28186db93
Fixes for the vscode language server extension (#4150)
Fix URL to the `OpenCL.DebugInfo.100` grammar file, which moved from `SPIRV-Tools` to `SPIRV-Headers`.

Add a `go.mod` and `go.sum` file.
Go has now fully migrated to using modules, and relative imports no longer work.
Fixup all the relative imports to use a fully qualified path based on the module name.

Fix the `.exe` executable extension on windows.

Update the generated grammar files.

Update the `README.md` with more information.

Disable generation of the log file. Seems to end up in the workspaceDir on windows, not the executable path
2021-02-26 18:07:00 +00:00
seppala2
ef3290bbea
spirv-opt: Don't call GenerateCopy for mismatched image types (#4126)
Avoid an assertion that will cause some HLSL shader to fail.  They will be legalized by later passes that will do copy propagation.
2021-02-19 10:59:14 -05:00