Add pass to reaplce invalid opcodes
authorSteven Perron <stevenperron@google.com>
Tue, 30 Jan 2018 16:24:03 +0000 (11:24 -0500)
committerSteven Perron <stevenperron@google.com>
Thu, 1 Feb 2018 20:25:09 +0000 (15:25 -0500)
commit61d8c0384b8400e5a88febb457611d22e36a76c8
tree938e83b01e53e591c9d67d3acddb66db368d55ef
parentd37869c8424582f84c0d4f38708751307ec1d67f
Add pass to reaplce invalid opcodes

Creates a pass that will remove instructions that are invalid for the
current shader stage.  For the instruction to be considered for replacement

1) The opcode must be valid for a shader modules.
2) The opcode must be invalid for the current shader stage.
3) All entry points to the module must be for the same shader stage.
4) The function containing the instruction must be reachable from an entry point.

Fixes #1247.
Android.mk
include/spirv-tools/optimizer.hpp
source/opt/CMakeLists.txt
source/opt/optimizer.cpp
source/opt/passes.h
source/opt/replace_invalid_opc.cpp [new file with mode: 0644]
source/opt/replace_invalid_opc.h [new file with mode: 0644]
test/opt/CMakeLists.txt
test/opt/pass_fixture.h
test/opt/replace_invalid_opc_test.cpp [new file with mode: 0644]
tools/opt/opt.cpp