OSDN Git Service

[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)
commitf764968e17754f4cf5ce9550cb7910cf4130b7d8
treecfcf9fd373cb36ea77474d0d6f39f59e5ead885a
parentc32dca7916435840140434e3fc0a76e8fd7eddb4
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351198 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/X86/buildvec-extract.ll