]> granicus.if.org Git - llvm/commit
[x86] improve AVX lowering of vector zext
authorSanjay Patel <spatel@rotateright.com>
Wed, 27 Mar 2019 22:42:11 +0000 (22:42 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 27 Mar 2019 22:42:11 +0000 (22:42 +0000)
commit6e543a2c82557cb059b06394e8815ad714ad3acb
treef7aeb23e0d51eeb6c790a6fae379a45c69d81336
parent8e4afeb5ff68f74e3a3924dcf34e7cfd7a18a209
[x86] improve AVX lowering of vector zext

If we know the 2 halves of an oversized zext-in-reg are the same,
don't create those halves independently.

I tried several different approaches to fold this, but it's difficult
to get right during legalization. In the default path, we are creating
a generic shuffle that looks like an unpack high, but it can get
transformed into a different mask (a blend), so it's not
straightforward to match that. If we try to fold after it actually
becomes an X86ISD::UNPCKH node, we can't be sure what the operand node
is - it might be a generic shuffle, or it could be some x86-specific op.

From the test output, we should be doing something like this for SSE4.1
as well, but I'd rather leave that as a follow-up since it involves
changing lowering actions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357129 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/vector-zext.ll