[X86] Don't emit *_extend_vector_inreg nodes when both the input and output types...
authorCraig Topper <craig.topper@intel.com>
Fri, 2 Nov 2018 21:09:49 +0000 (21:09 +0000)
committerCraig Topper <craig.topper@intel.com>
Fri, 2 Nov 2018 21:09:49 +0000 (21:09 +0000)
commit60c202a4941141c4f211af507e3f5bc44fc63230
tree5790506dc1d9890e619a117827684cc63455047c
parent3095874d3c100261de79b4105ebd4a616332df46
[X86] Don't emit *_extend_vector_inreg nodes when both the input and output types are legal with AVX1

We already have custom lowering for the AVX case in LegalizeVectorOps. So its better to keep the regular extend op around as long as possible.

I had to qualify one place in DAG combine that created illegal vector extending load operations. This change by itself had no effect on any tests which is why its included here.

I've made a few cleanups to the custom lowering. The sign extend code no longer creates an identity shuffle with undef elements. The zero extend code now emits a zero_extend_vector_inreg instead of an unpckl with a zero vector.

For the high half of the custom lowering of zero_extend/any_extend, we're now using an unpckh with a zero vector or undef. Previously we used used a pshufd to move the upper 64-bits to the lower 64-bits and then used a zero_extend_vector_inreg. I think the zero vector should require less execution resources and be smaller code size.

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

llvm-svn: 346043
12 files changed:
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/avg.ll
llvm/test/CodeGen/X86/cast-vsel.ll
llvm/test/CodeGen/X86/madd.ll
llvm/test/CodeGen/X86/psubus.ll
llvm/test/CodeGen/X86/shrink_vmul.ll
llvm/test/CodeGen/X86/v8i1-masks.ll
llvm/test/CodeGen/X86/vec_cast2.ll
llvm/test/CodeGen/X86/vec_int_to_fp.ll
llvm/test/CodeGen/X86/vector-pcmp.ll
llvm/test/CodeGen/X86/vector-zext.ll