diff options
author | GregF <greg@LunarG.com> | 2017-06-16 15:37:31 -0600 |
---|---|---|
committer | David Neto <dneto@google.com> | 2017-07-07 17:54:21 -0400 |
commit | cc8bad3a5b5d75921602720cd6a8957e2b716986 (patch) | |
tree | df7cb96b0cde22321af1c14cd8d8f76e51bf0eb1 /source/opt/module.h | |
parent | 52e247f2216911507d2b9ab9b53c591e4b8c9d6f (diff) | |
download | SPIRV-Tools-cc8bad3a5b5d75921602720cd6a8957e2b716986.tar.gz SPIRV-Tools-cc8bad3a5b5d75921602720cd6a8957e2b716986.tar.bz2 SPIRV-Tools-cc8bad3a5b5d75921602720cd6a8957e2b716986.zip |
Add LocalMultiStoreElim pass
A SSA local variable load/store elimination pass.
For every entry point function, eliminate all loads and stores of function
scope variables only referenced with non-access-chain loads and stores.
Eliminate the variables as well.
The presence of access chain references and function calls can inhibit
the above optimization.
Only shader modules with logical addressing are currently processed.
Currently modules with any extensions enabled are not processed. This
is left for future work.
This pass is most effective if preceeded by Inlining and
LocalAccessChainConvert. LocalSingleStoreElim and LocalSingleBlockElim
will reduce the work that this pass has to do.
Diffstat (limited to 'source/opt/module.h')
-rw-r--r-- | source/opt/module.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/opt/module.h b/source/opt/module.h index 37d49025..91454a5e 100644 --- a/source/opt/module.h +++ b/source/opt/module.h @@ -112,6 +112,10 @@ class Module { IteratorRange<inst_iterator> annotations(); IteratorRange<const_inst_iterator> annotations() const; + // Iterators for extension instructions contained in this module. + IteratorRange<inst_iterator> extensions(); + IteratorRange<const_inst_iterator> extensions() const; + // Iterators for types, constants and global variables instructions. inline inst_iterator types_values_begin(); inline inst_iterator types_values_end(); @@ -235,6 +239,14 @@ inline IteratorRange<Module::const_inst_iterator> Module::annotations() const { return make_const_range(annotations_); } +inline IteratorRange<Module::inst_iterator> Module::extensions() { + return make_range(extensions_); +} + +inline IteratorRange<Module::const_inst_iterator> Module::extensions() const { + return make_const_range(extensions_); +} + inline Module::inst_iterator Module::types_values_begin() { return inst_iterator(&types_values_, types_values_.begin()); } |