InsertExtractElim: Optimize through VectorShuffle, Mix
authorGreg Fischer <greg@lunarg.com>
Fri, 29 Dec 2017 23:44:43 +0000 (16:44 -0700)
committerSteven Perron <stevenperron@google.com>
Fri, 12 Jan 2018 14:41:45 +0000 (09:41 -0500)
commit5eafc00ad58266dc574d9defd6cba83bee566956
tree61b9a57a1c4b618d74bb4e6165f272935f485146
parent1ebd860daabf3328715d010af39f4950ec26d9c6
InsertExtractElim: Optimize through VectorShuffle, Mix

This improves Extract replacement to continue through VectorShuffle.
It will also handle Mix with 0.0 or 1.0 in the a-value of the desired
component.

To facilitate optimization of VectorShuffle, the algorithm was refactored
to pass around the indices of the extract in a vector rather than pass the
extract instruction itself. This allows the indices to be modified as the
algorithm progresses.
source/opt/insert_extract_elim.cpp
source/opt/insert_extract_elim.h
test/opt/insert_extract_elim_test.cpp