Add global redundancy elimination
authorSteven Perron <stevenperron@google.com>
Mon, 4 Dec 2017 17:29:51 +0000 (12:29 -0500)
committerSteven Perron <stevenperron@google.com>
Thu, 7 Dec 2017 23:35:38 +0000 (18:35 -0500)
commit5d602abd66c879382803dbd428729a9799906d86
tree4cf3fad3d9f698e7a020285364fe6a5fc89d9d36
parent851e1ad98597bfed5f9e7b0496b92411ea7f1c35
Add global redundancy elimination

Adds a pass that looks for redundant instruction in a function, and
removes them.  The algorithm is a hash table based value numbering
algorithm that traverses the dominator tree.

This pass removes completely redundant instructions, not partially
redundant ones.
14 files changed:
Android.mk
include/spirv-tools/optimizer.hpp
source/opt/CMakeLists.txt
source/opt/local_redundancy_elimination.cpp
source/opt/local_redundancy_elimination.h
source/opt/optimizer.cpp
source/opt/passes.h
source/opt/redundancy_elimination.cpp [new file with mode: 0644]
source/opt/redundancy_elimination.h [new file with mode: 0644]
source/opt/value_number_table.cpp
source/opt/value_number_table.h
test/opt/CMakeLists.txt
test/opt/redundancy_elimination_test.cpp [new file with mode: 0644]
tools/opt/opt.cpp