[X86][MMX] Support MMX build vectors to avoid SSE usage (PR29222)
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 11 Mar 2018 19:22:13 +0000 (19:22 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 11 Mar 2018 19:22:13 +0000 (19:22 +0000)
commitd09cc9c62c61c38e0793f4b56389453bb7a82d51
treebc219d317ac0562e1c5da8c4d2fd251214c5355c
parent55ed3dc67671a3ba36bada09aee57e1bb181e5a1
[X86][MMX] Support MMX build vectors to avoid SSE usage (PR29222)

64-bit MMX vector generation usually ends up lowering into SSE instructions before being spilled/reloaded as a MMX type.

This patch creates a MMX vector from MMX source values, taking the lowest element from each source and constructing broadcasts/build_vectors with direct calls to the MMX PUNPCKL/PSHUFW intrinsics.

We're missing a few consecutive load combines that could be handled in a future patch if that would be useful - my main interest here is just avoiding a lot of the MMX/SSE crossover.

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

llvm-svn: 327247
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/3dnow-intrinsics.ll
llvm/test/CodeGen/X86/mmx-build-vector.ll
llvm/test/CodeGen/X86/pr29222.ll
llvm/test/CodeGen/X86/vec_insert-mmx.ll