summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-08-07Unify validation of OpCopyMemory*HEADmasterAlan Baker2-95/+346
Fixes #1800 * Refactored duplication of code between OpCopyMemory and OpCopyMemorySized validation * Fixed some bugs in OpCopyMemorySized validation * Replaced asserts with checks * Added new tests
2018-08-07Refactor where opcodes are validatedAlan Baker9-76/+114
* Replaced uses in opcode validation of current_function() * Added non-const accessor to function lookup in ValidationState_t * Updated a couple bad tests due to check reordering
2018-08-07When clang is used as a MSVC frontend (clang-cl.exe) it does not behave ↵shartte1-1/+1
exactly as GCC would. I.e. -Wall translates to /Wall, which is an alias for -Weverything. This causes massive C++98 compat warnings logspam. (#1808)
2018-08-07Remove unused bit stream methods. (#1807)dan sinclair3-725/+75
This CL deletes methods from bit stream which are never used and moves several to the anonymous namespace in the bit_stream test file.
2018-08-07Simplify MoveToFront (#1806)dan sinclair6-590/+489
This CL removes the templating from the MoveToFront code as all non-test code uses uint32_t as the variable.
2018-08-07Fixup readabilty/inheritance warnings (#1805)dan sinclair6-7/+6
This CL removes the un-needed virtual qualifiers from methods already marked as override.
2018-08-07Fix readbility/braces warnings (#1804)dan sinclair11-24/+27
2018-08-03Cleanup includes. (#1795)dan sinclair481-1606/+2060
This Cl cleans up the include paths to be relative to the top level directory. Various include-what-you-use fixes have been added.
2018-08-03Refactor BUILD.gn so can easily be embedded in other projectsCorentin Wallez12-499/+59
1. BUILD.gn: Don't use the extra Chromium clang warnings Also removes the unused .gn secondary_sources. 2. Move fuzzers in test/ instead of testing/ This frees up testing/ to be the git subtree of Chromium's src/testing/ that contains test.gni, gtest, gmock and libfuzzer 3. DEPS: get the whole testing/ subtree of Chromium 4. BUILD.gn: Simplify the standalone gtest targets These targets definitions are inspired from ANGLE's and add a variable that is the path of the googletest directory so that it can be made overridable in future commits. 6. BUILD.gn: Add overridable variables for deps dirs This avoids hardcoded paths to dependencies that make it hard to integrate SPIRV-Tools in other GN projects.
2018-08-03Fixup Wno-self-assign warning (#1796)dan sinclair1-1/+5
The warning should only be applied for Clang builds, it was accidentally also being included for GCC builds.
2018-08-03Remove using namespace commands. (#1794)dan sinclair3-26/+26
This CL removes the last two 'using namespace' commands.
2018-08-03Rewrite include guards (#1793)dan sinclair151-445/+445
This CL rewrites the include guards to make PRESUBMIT.py include guard check happy.
2018-08-02Script to fixup fuzzer results (#1792)dan sinclair1-0/+25
2018-08-02Validation within function body when doing a FunctionCall. (#1790)dan sinclair2-1/+22
When validating a FunctionCall we can trigger an assert if we are not currently within a function body. This CL adds verification that we are within a function before attempting to add a function call. Issue 1789.
2018-08-02Simplify validation ProcessInstruction (#1786)dan sinclair4-123/+128
This CL moves most of the logic out of validation ProcessInstruction and groups it into validate. This places all of the validation logic in the same place making it clearer what is running. The Instruction class is changed to allow setting the function and block after creation.
2018-08-02Add more fuzzers for Optimizer. (#1788)dan sinclair5-5/+111
This Cl adds the legalization and size fuzzers for the optimizer. The main optimizer is renamed to the performance optimizer.
2018-08-02Register passes in the spirv-opt fuzzer. (#1785)Steven Perron1-0/+1
The spirv-opt fuzzer is not registering any passes to run, so it is not currently testing anything. For now we will just register the performance passes. We should add different fuzzers for the legalization pass (RegisterLegalizationPasses()), and the size passes (RegisterSizePasses()).
2018-08-02Remove ValidateInstructionAndUpdateValidationState (#1784)dan sinclair4-159/+103
This CL changes the stats aggregator to use ValidateBinaryAndKeepValidationState to process the binary. This means we can remove ValidateInstructionAndUpdateValidationState which expects to be able to call ProcessInstruction in the validate anonymous namespace. This decouples the stats aggregator from how validation processes the binary.
2018-08-02Update OpPhi instructions after splitting block. (#1783)Steven Perron3-4/+68
In the merge return pass, we will split a block, but not update the phi instructions that reference the block. Since the branch in the original block is now part of the block with the new id, the phi nodes must be updated. This commit will change this. I have also considered other places where an id of a basic block could be referenced, and I don't think any of them need to change. 1) Branch and merge instructions: These jump to the start of the original block, and so we want them to jump to the block that uses the original id. Nothing needs to change. 2) Names and decorations: I don't think it matters with block keeps the name, and there are no decorations that apply to basic blocks. Fixes #1736.
2018-08-02Combine ordered_instruction loops in validation. (#1782)dan sinclair5-96/+100
There are several validation passes which loop over all ordered instructions. This CL combines those into a single loop, calling each pass as needed.
2018-08-01 Remove instruction_counter from ValidationState. (#1781)dan sinclair6-27/+10
The instruction counter is the same as the size of the ordered_instruction list when we insert a new instruction. This Cl removes instruction_counter_ and uses that instead.
2018-08-01Move memory class instructions to new passAlan Baker7-562/+610
* Refactored the Memory class of instructions in the spec out Id validation and into a new pass * Tests unmodified * some minor disassembly changes * minor style changes
2018-08-01Remove using std::<foo> statements. (#1756)dan sinclair34-1696/+1647
Many of the files have using std::<foo> statements in them, but then the use of <foo> will be inconsistently std::<foo> or <foo> scattered through the file. This CL removes all of the using statements and updates the code to have the required std:: prefix.
2018-08-01Remove diag() overloads. (#1776)dan sinclair4-20/+8
This CL removes the two diag() overloads and leaves only the version which accepts an Instruction. This is safer as we never use the implicit location from the validation state.
2018-08-01Fixup BUILD.gn to use a group for SPIRV-Tools (#1779)dan sinclair1-1/+1
The SPIRV-Tools target doesn't build anything, it just depends on the other libraries. As such, there is no static_library generated and this should be a group() instead.
2018-08-01Update diag() calls in validate_capability. (#1759)dan sinclair1-5/+5
This CL updates the diag() call in validate_capability to provide the instruction.
2018-08-01Don't change decorations and names in merge return. (#1777)Steven Perron2-9/+109
When creating a new phi for a value in the function, merge return will rewrite all uses of an id that are no longer dominated by its definition. Uses that are not in a basic block, like OpName or decorations, are not dominated, but they should not be replaced. Fixes #1736.
2018-08-01Update diag() calls in validate_type_unique. (#1775)dan sinclair1-1/+1
This CL updates the diag() calls in validate_type_unique to pass the relevant instruction.
2018-08-01Update diag() calls in validate_primitives. (#1774)dan sinclair1-2/+2
This CL updates the diag() calls in validate_primitives to provide the relevant instruction.
2018-08-01Update diag() calls in validate_non_uniform. (#1773)dan sinclair1-5/+5
This CL upldates diag() calls in validate_non_uniform to provide the relevant instruction.
2018-08-01Update diag() calls in validate_logicals. (#1772)dan sinclair1-24/+24
This CL updates the diag() calls in validate_logicals to provide the Instruction.
2018-08-01Update diag() calls in validate_literals. (#1771)dan sinclair1-1/+1
This CL updates the diag() call in validate_literals to provide the relevant instruction.
2018-08-01Update diag() calls in validate_layout. (#1770)dan sinclair1-16/+16
This CL updates the diag() calls in validate_layout to pass the relevant instruction.
2018-08-01Update diag() call in validate_interface. (#1769)dan sinclair1-1/+1
This CL upldates validate_interface to pass the instruction to the diag() method.
2018-08-01Update diag() calls in validate_instruction. (#1768)dan sinclair1-41/+39
This CL updates validate_instruction to pass the Instruction to diag().
2018-08-01Update diag() calls in validate_image. (#1767)dan sinclair1-155/+167
This CL updates the diag() calls in validate_image to provide the relvant instruction.
2018-08-01Update diag() calls in validate_ext_inst. (#1766)dan sinclair1-197/+197
This CL updates the diag() usage in validate_ext_inst to provide the relevant instruction.
2018-08-01Update diag() calls in validate_derivatives. (#1765)dan sinclair1-2/+2
This CL updates diag() in validate_derivatives to provide the instruction of interest.
2018-08-01Update diag() calls in validate_decorations. (#1764)dan sinclair1-15/+19
Several of the diag() calls in validate_decorations do not provide the line number, and will output the last line in the file. This CL updates the diag() calls to provide the instruction of interest.
2018-08-01Remove std::deque in favour of std::vector. (#1755)dan sinclair6-29/+64
This CL removes the two deque's from ValidationState and converts them into std::vectors. In order to maintain the stability of instructions we walk over the binary and counter the instructions and functions in the ValidationState constructor and reserve the required number of items in the module_functions_ and ordered_instructions_ vectors. Issue #1176.
2018-08-01Update diag() calls in validate_datarules. (#1763)dan sinclair1-22/+22
This CL updates validate_datarules to provide the instruction to diag().
2018-08-01Update CHANGESDavid Neto1-3/+13
2018-08-01Update diag() calls in validate_conversion. (#1762)dan sinclair1-52/+52
This CL updates validate_conversion to provide the instruction to diag() calls.
2018-08-01Update diag() calls in validate_composites. (#1761)dan sinclair1-34/+36
This CL updates the diag() calls in validate_composites to provide the instruction directly.
2018-08-01Update diag() calls in validate_cfg. (#1760)dan sinclair2-5/+5
This CL updates the diag() calls in validate_cfg to provide the associated instruction. This fixes a couple places where we output the last line of the file instead of the instruction as the disassembly.
2018-08-01Update diag() use in validate_builtin. (#1758)dan sinclair1-109/+123
This CL updates the calls to diag() in vlidate_builtings to provide the instruction.
2018-08-01Update diag() usage in validate_bitwise. (#1757)dan sinclair1-24/+24
This Cl upldates the diag() calls to pass the instruction in validate_bitwise.
2018-07-31Update diag() in validate_barriers (#1754)dan sinclair1-13/+13
This CL updates validate_barriers to provide an explicit instruction when calling diag().
2018-07-31Update diag() in validate_atomics (#1753)dan sinclair1-22/+22
This CL updates validate_atomics to explicitly provide the instruction when caling diag().
2018-07-31Pass the instruction to diag in arithmetic validation (#1752)dan sinclair1-50/+50
This CL updates the diag() calls in validate_arithmetics to explicitly provide the instruction the diagnostic is attached too.