[X86] Add target combine rule to select ADDSUB instructions from a build_vector
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Wed, 25 Jun 2014 10:02:21 +0000 (10:02 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Wed, 25 Jun 2014 10:02:21 +0000 (10:02 +0000)
commit3e5582cc15639f7c908326a7c15b941fb3253a33
tree9c04cbc46280ed543efd6ff268a931ad2e0f5bf7
parent97c856a6126f0853dd894cc5f78dfaa574c78540
[X86] Add target combine rule to select ADDSUB instructions from a build_vector

This patch teaches the backend how to combine a build_vector that implements
an 'addsub' between packed float vectors into a sequence of vector add
and vector sub followed by a VSELECT.

The new VSELECT is expected to be lowered into a BLENDI.
At ISel stage, the sequence 'vector add + vector sub + BLENDI' is
pattern-matched against ISel patterns added at r211427 to select
'addsub' instructions.
Added three more ISel patterns for ADDSUB.

Added test sse3-avx-addsub-2.ll to verify that we correctly emit 'addsub'
instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211679 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86InstrSSE.td
test/CodeGen/X86/sse3-avx-addsub-2.ll [new file with mode: 0644]