Initial implementation of if conversion
authorAlan Baker <alanbaker@google.com>
Tue, 16 Jan 2018 16:15:06 +0000 (11:15 -0500)
committerAlan Baker <alanbaker@google.com>
Thu, 25 Jan 2018 17:42:00 +0000 (09:42 -0800)
commit2e93e806e454e2cfefabf217320038188c6c1fb6
tree056b1c576238a0854942cc734619af5c42c1eebe
parentb2eb8404689a38dfeeb3aad51715bec4b9faf6f2
Initial implementation of if conversion

* Handles simple cases only
* Identifies phis in blocks with two predecessors and attempts to
convert the phi to an select
 * does not perform code motion currently so the converted values must
 dominate the join point (e.g. can't be defined in the branches)
 * limited for now to two predecessors, but can be extended to handle
 more cases
* Adding if conversion to -O and -Os
18 files changed:
Android.mk
include/spirv-tools/optimizer.hpp
source/opt/CMakeLists.txt
source/opt/basic_block.h
source/opt/dominator_analysis.cpp [new file with mode: 0644]
source/opt/dominator_analysis.h
source/opt/if_conversion.cpp [new file with mode: 0644]
source/opt/if_conversion.h [new file with mode: 0644]
source/opt/ir_builder.h
source/opt/optimizer.cpp
source/opt/passes.h
test/opt/CMakeLists.txt
test/opt/dominator_tree/CMakeLists.txt
test/opt/dominator_tree/common_dominators.cpp [new file with mode: 0644]
test/opt/if_conversion_test.cpp [new file with mode: 0644]
test/opt/ir_builder.cpp
tools/opt/opt.cpp
utils/check_copyright.py