aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlan Baker <alanbaker@google.com>2018-01-16 11:15:06 -0500
committerAlan Baker <alanbaker@google.com>2018-01-25 09:42:00 -0800
commit2e93e806e454e2cfefabf217320038188c6c1fb6 (patch)
tree056b1c576238a0854942cc734619af5c42c1eebe /include
parentb2eb8404689a38dfeeb3aad51715bec4b9faf6f2 (diff)
downloadspirv-tools-2e93e806e454e2cfefabf217320038188c6c1fb6.tar.gz
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
Diffstat (limited to 'include')
-rw-r--r--include/spirv-tools/optimizer.hpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/spirv-tools/optimizer.hpp b/include/spirv-tools/optimizer.hpp
index d1679abc..b1e2cfe0 100644
--- a/include/spirv-tools/optimizer.hpp
+++ b/include/spirv-tools/optimizer.hpp
@@ -482,6 +482,9 @@ Optimizer::PassToken CreateCCPPass();
// Current workaround: Avoid OpUnreachable instructions in loops.
Optimizer::PassToken CreateWorkaround1209Pass();
+// Creates a pass that converts if-then-else like assignments into OpSelect.
+Optimizer::PassToken CreateIfConversionPass();
+
} // namespace spvtools
#endif // SPIRV_TOOLS_OPTIMIZER_HPP_