SPIRV-Tools/tools
Steven Perron c4dc046399 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.
2018-03-26 14:44:41 -04:00
..
as Support SPIR-V 1.3 and Vulkan 1.1 2018-03-06 15:17:31 -05:00
cfg Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
comp Add new compression algorithm and models 2017-11-21 17:32:58 -05:00
dis Support SPIR-V 1.3 and Vulkan 1.1 2018-03-06 15:17:31 -05:00
emacs Define variable to skip installation 2017-07-04 12:24:44 -04:00
lesspipe Define variable to skip installation 2017-07-04 12:24:44 -04:00
link linker: Allow modules to be partially linked 2018-02-27 12:21:13 -05:00
opt Copy propagate arrays 2018-03-26 14:44:41 -04:00
stats Consistently include latest spirv.h header file. 2018-02-27 18:47:29 -05:00
val Fixes compile errors generated with -Wpedantic 2018-03-22 09:40:11 -04:00
CMakeLists.txt Add new compression algorithm and models 2017-11-21 17:32:58 -05:00
io.h Relicense SPIRV-Tools under Apache 2.0 2016-09-02 10:00:29 -04:00