SPIRV-Tools/include/spirv-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
..
libspirv.h Migrate to use unified grammar tables 2018-03-17 15:25:26 -04:00
libspirv.hpp Allow relaxing validation of pointers in logical addressing mode 2018-01-08 10:36:23 -05:00
linker.hpp linker: Allow modules to be partially linked 2018-02-27 12:21:13 -05:00
optimizer.hpp Copy propagate arrays 2018-03-26 14:44:41 -04:00