aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSteven Perron <stevenperron@google.com>2017-12-11 13:10:24 -0500
committerSteven Perron <stevenperron@google.com>2017-12-19 14:21:04 -0500
commitb86eb6842b4d95860828c58fd6f44a91801334be (patch)
treeae899a77a83a307f4f42e8c002aa311f9bcd13ea /include
parent8135dd6375b7b99442089bd1352d5c4f4db8aecc (diff)
downloadspirv-tools-b86eb6842b4d95860828c58fd6f44a91801334be.tar.gz
Convert private variables to function scope.
When a private variable is used in a single function, it can be converted to a function scope variable in that function. This adds a pass that does that. The pass can be enabled using the option `--private-to-local`. This transformation allows other transformations to act on these variables. Also moved `FindPointerToType` from the inline class to the type manager.
Diffstat (limited to 'include')
-rw-r--r--include/spirv-tools/optimizer.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/spirv-tools/optimizer.hpp b/include/spirv-tools/optimizer.hpp
index 754d2b99..f5cdee24 100644
--- a/include/spirv-tools/optimizer.hpp
+++ b/include/spirv-tools/optimizer.hpp
@@ -442,6 +442,12 @@ Optimizer::PassToken CreateRedundancyEliminationPass();
// This pass replaces composite function scope variables with variables for each
// element if those elements are accessed individually.
Optimizer::PassToken CreateScalarReplacementPass();
+
+// Create a private to local pass.
+// This pass looks for variables delcared in the private storage class that are
+// used in only one function. Those variables are moved to the function storage
+// class in the function that they are used.
+Optimizer::PassToken CreatePrivateToLocalPass();
} // namespace spvtools
#endif // SPIRV_TOOLS_OPTIMIZER_HPP_