aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSteven Perron <stevenperron@google.com>2017-11-10 20:26:55 -0500
committerSteven Perron <stevenperron@google.com>2017-11-23 11:45:09 -0500
commit28c415500dc0f4bddfbe2bff00f83a92f2680ded (patch)
tree18f47ce4f16be3c807c4fe8248e22f0ec57ebc2f /include
parentf407ae2b5004a2a53e4f303b8b44c868d1c4c228 (diff)
downloadspirv-tools-28c415500dc0f4bddfbe2bff00f83a92f2680ded.tar.gz
Create a local value numbering pass
Creates a pass that removes redundant instructions within the same basic block. This will be implemented using a hash based value numbering algorithm. Added a number of functions that check for the Vulkan descriptor types. These are used to determine if we are variables are read-only or not. Implemented a function to check if loads and variables are read-only. Implemented kernel specific and shader specific versions. A big change is that the Combinator analysis in ADCE is factored out into the IRContext as an analysis. This was done because it is being reused in the value number table.
Diffstat (limited to 'include')
-rw-r--r--include/spirv-tools/optimizer.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/spirv-tools/optimizer.hpp b/include/spirv-tools/optimizer.hpp
index b3d34b42..9314adc6 100644
--- a/include/spirv-tools/optimizer.hpp
+++ b/include/spirv-tools/optimizer.hpp
@@ -418,6 +418,10 @@ Optimizer::PassToken CreateDeadVariableEliminationPass();
// the shader capability is detected.
Optimizer::PassToken CreateMergeReturnPass();
+// Create value numbering pass.
+// This pass will look for instructions in the same basic block that compute the
+// same value, and remove the redundant ones.
+Optimizer::PassToken CreateLocalRedundancyEliminationPass();
} // namespace spvtools
#endif // SPIRV_TOOLS_OPTIMIZER_HPP_