diff options
author | Alan Baker <alanbaker@google.com> | 2017-11-08 16:22:10 -0500 |
---|---|---|
committer | David Neto <dneto@google.com> | 2017-11-15 10:27:04 -0500 |
commit | a92d69b43d4203218362b78980164d50e21ac3f5 (patch) | |
tree | d8678a9f8737626abca7a06154f23fb5259d32be /include | |
parent | 0126ad97856bf2cfc43ed2b7a0e56b9b14588de0 (diff) | |
download | spirv-tools-a92d69b43d4203218362b78980164d50e21ac3f5.tar.gz |
Initial implementation of merge return pass.
Works with current DefUseManager infrastructure.
Added merge return to the standard opts.
Added validation to passes.
Disabled pass for shader capabilty.
Diffstat (limited to 'include')
-rw-r--r-- | include/spirv-tools/optimizer.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/spirv-tools/optimizer.hpp b/include/spirv-tools/optimizer.hpp index 8d9f94d5..b3d34b42 100644 --- a/include/spirv-tools/optimizer.hpp +++ b/include/spirv-tools/optimizer.hpp @@ -406,6 +406,18 @@ Optimizer::PassToken CreateCFGCleanupPass(); // that are not referenced. Optimizer::PassToken CreateDeadVariableEliminationPass(); +// Create merge return pass. +// This pass replaces all returns with unconditional branches to a new block +// containing a return. If necessary, this new block will contain a PHI node to +// select the correct return value. +// +// This pass does not consider unreachable code, nor does it perform any other +// optimizations. +// +// This pass does not currently support structured control flow. It bails out if +// the shader capability is detected. +Optimizer::PassToken CreateMergeReturnPass(); + } // namespace spvtools #endif // SPIRV_TOOLS_OPTIMIZER_HPP_ |