summaryrefslogtreecommitdiff
path: root/Android.mk
diff options
context:
space:
mode:
authorSteven Perron <stevenperron@google.com>2018-03-20 23:33:24 -0400
committerSteven Perron <stevenperron@google.com>2018-03-26 14:44:41 -0400
commitc4dc04639904479f4418a86d2d1641514047bbff (patch)
tree1b3c06931b3c4fcc70f422941230062e25b82796 /Android.mk
parent0a8b6a96e162d1a1c57968a09f4ff22197ecc258 (diff)
Copy propagate arrays
The sprir-v generated from HLSL code contain many copyies of very large arrays. Not only are these time consumming, but they also cause problems for drivers because they require too much space. To work around this, we will implement an array copy propagation. Note that we will not implement a complete array data flow analysis in order to implement this. We will be looking for very simple cases: 1) The source must never be stored to. 2) The target must be stored to exactly once. 3) The store to the target must be a store to the entire array, and be a copy of the entire source. 4) All loads of the target must be dominated by the store. The hard part is keeping all of the types correct. We do not want to have to do too large a search to update everything, which may not be possible, do we give up if we see any instruction that might be hard to update. Also in types.h, the element decorations are not stored in an std::map. This change was done so the hashing algorithm for a Struct is consistent. With the std::unordered_map, the traversal order was non-deterministic leading to the same type getting hashed to different values. See |Struct::GetExtraHashWords|. Contributes to #1416.
Diffstat (limited to 'Android.mk')
-rw-r--r--Android.mk1
1 files changed, 1 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
index 5c6cea24..b0f3adfa 100644
--- a/Android.mk
+++ b/Android.mk
@@ -70,6 +70,7 @@ SPVTOOLS_OPT_SRC_FILES := \
source/opt/composite.cpp \
source/opt/const_folding_rules.cpp \
source/opt/constants.cpp \
+ source/opt/copy_prop_arrays.cpp \
source/opt/dead_branch_elim_pass.cpp \
source/opt/dead_insert_elim_pass.cpp \
source/opt/dead_variable_elimination.cpp \