[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)
commit6d9b9e125dd69e639d30cd80ef1a64726da26927
tree5420996aa0446802f489b674912d9079b7c1ccf7
parentd99cca2c7a30fd9b0a7df3b509eb5c9b39cd0d3a
[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.

llvm-svn: 211679
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86InstrSSE.td
llvm/test/CodeGen/X86/sse3-avx-addsub-2.ll [new file with mode: 0644]