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:29:14 -0500
commit79a00649b4fdcbbbaeb47f0081e28ea40c886f0a (patch)
treed0f2df0de862f1b970de2bd41758fdd81a30520e /include
parentb86eb6842b4d95860828c58fd6f44a91801334be (diff)
downloadspirv-tools-79a00649b4fdcbbbaeb47f0081e28ea40c886f0a.tar.gz
Allow pointers to pointers in logical addressing mode.
A few optimizations are updates to handle code that is suppose to be using the logical addressing mode, but still has variables that contain pointers as long as the pointer are to opaque objects. This is called "relaxed logical addressing". |Instruction::GetBaseAddress| will check that pointers that are use meet the relaxed logical addressing rules. Optimization that now handle relaxed logical addressing instead of logical addressing are: - aggressive dead-code elimination - local access chain convert - local store elimination passes.
Diffstat (limited to 'include')
-rw-r--r--include/spirv-tools/optimizer.hpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/include/spirv-tools/optimizer.hpp b/include/spirv-tools/optimizer.hpp
index f5cdee24..5d2e306e 100644
--- a/include/spirv-tools/optimizer.hpp
+++ b/include/spirv-tools/optimizer.hpp
@@ -271,7 +271,8 @@ Optimizer::PassToken CreateInlineOpaquePass();
// The presence of access chain references and function calls can inhibit
// the above optimization.
//
-// Only modules with logical addressing are currently processed.
+// Only modules with relaxed logical addressing (see opt/instruction.h) are
+// currently processed.
//
// This pass is most effective if preceeded by Inlining and
// LocalAccessChainConvert. This pass will reduce the work needed to be done
@@ -305,9 +306,9 @@ Optimizer::PassToken CreateDeadBranchElimPass();
// 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.
+// Only shader modules with relaxed logical addressing (see opt/instruction.h)
+// 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
@@ -344,6 +345,9 @@ Optimizer::PassToken CreateLocalAccessChainConvertPass();
// not supported and will prohibit optimization of a function. Support of
// these operations are future work.
//
+// Only shader modules with relaxed logical addressing (see opt/instruction.h)
+// are currently processed.
+//
// This pass will reduce the work needed to be done by LocalSingleBlockElim
// and LocalMultiStoreElim and can improve the effectiveness of other passes
// such as DeadBranchElimination which depend on values for their analysis.
@@ -384,8 +388,8 @@ Optimizer::PassToken CreateCommonUniformElimPass();
// time cost over standard dead code elimination.
//
// This pass only processes entry point functions. It also only processes
-// shaders with logical addressing. It currently will not process functions
-// with function calls.
+// shaders with relaxed logical addressing (see opt/instruction.h). It currently
+// will not process functions with function calls.
//
// This pass will be made more effective by first running passes that remove
// dead control flow and inlines function calls.