This is the final patch that D25580 is split into. It adds the changes to the PPCMIPeephole.cpp that eliminate the redundancies that the new handling of BUILD_VECTOR nodes introduces. It also includes the test case that integrates the testing of all these changes. Please note that Phabricator has a tendency to collapse large files so you may miss the test case in the review altogether - please ensure to expand the file in your view.
The motivation for this patch:
Emitting reasonable code for BUILD_VECTOR nodes is fairly important due to the prevalence of these nodes. There are currently a number of patterns (some common and some less so) for which the PPC back end produces just terrible code. The idea with this series of patches is to identify as many as possible of those patterns and improve the code gen for them. Overall, this improves performance of the benchmarks in projects/test-suite and when I get the chance, I'll evaluate the effect of these patches on SPEC.
I will add a comment illustrating some patterns where the current code gen is terrible (I don't do it in the description as I don't know how to add code here).