[X86][SSE] Avoid specifying unused arguments in SHUFPD lowering
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 22 Aug 2016 12:56:54 +0000 (12:56 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 22 Aug 2016 12:56:54 +0000 (12:56 +0000)
commit2279e595737524c6133fddad91634a28c12cd07c
treea37d3d4c092eb008896bf2ab08b04a3a7cb3f579
parentf0ed16eae58479155639e601bbfbff961f2cc49a
[X86][SSE] Avoid specifying unused arguments in SHUFPD lowering

As discussed on PR26491, we are missing the opportunity to make use of the smaller MOVHLPS instruction because we set both arguments of a SHUFPD when using it to lower a single input shuffle.

This patch sets the lowered argument to UNDEF if that shuffle element is undefined. This in turn makes it easier for target shuffle combining to decode UNDEF shuffle elements, allowing combines to MOVHLPS to occur.

A fix to match against MOVHPD stores was necessary as well.

This builds on the improved MOVLHPS/MOVHLPS lowering and memory folding support added in D16956

Adding similar support for SHUFPS will have to wait until have better support for target combining of binary shuffles.

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

llvm-svn: 279430
14 files changed:
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86InstrSSE.td
llvm/test/CodeGen/X86/haddsub-2.ll
llvm/test/CodeGen/X86/haddsub-undef.ll
llvm/test/CodeGen/X86/nontemporal-2.ll
llvm/test/CodeGen/X86/pr11334.ll
llvm/test/CodeGen/X86/sse2-intrinsics-fast-isel.ll
llvm/test/CodeGen/X86/sse3-avx-addsub-2.ll
llvm/test/CodeGen/X86/sse_partial_update.ll
llvm/test/CodeGen/X86/vec_extract.ll
llvm/test/CodeGen/X86/vec_fp_to_int.ll
llvm/test/CodeGen/X86/vector-rem.ll
llvm/test/CodeGen/X86/widen_conv-3.ll
llvm/test/CodeGen/X86/widen_conv-4.ll