[DAGCombiner] reduce buildvec of zexted extracted element to shuffle
authorSanjay Patel <spatel@rotateright.com>
Tue, 15 Jan 2019 16:11:05 +0000 (16:11 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 15 Jan 2019 16:11:05 +0000 (16:11 +0000)
commitfad5bdaf952bdc43fde97a45333356224cf65f87
tree712a7b5a060e51f2be4417ebf9d2b815a2246b16
parent2b46d30fc7049fc5cc5b9f98df654509bb4d61a2
[DAGCombiner] reduce buildvec of zexted extracted element to shuffle

The motivating case for this is shown in the first regression test. We are
transferring to scalar and back rather than just zero-extending with 'vpmovzxdq'.

That's a special-case for a more general pattern as shown here. In all tests,
we're avoiding the vector-scalar-vector moves in favor of vector ops.

We aren't producing optimal shuffle code in some cases though, so the patch is
limited to reduce regressions.

Differential Revision: https://reviews.llvm.org/D56281

llvm-svn: 351198
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/buildvec-extract.ll