[X86] Improved target combine rules for selecting horizontal add/sub.
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Tue, 10 Jun 2014 16:42:57 +0000 (16:42 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Tue, 10 Jun 2014 16:42:57 +0000 (16:42 +0000)
commitc0edcf7de8ebddf4524e8d6fa5805ab96dd5a99e
treeb3e44070de9d515dc1183b42e5d420596b09d635
parent7dd65e6ceed339bdd3fedfd5ba177b6fdad7ad30
[X86] Improved target combine rules for selecting horizontal add/sub.

This patch slightly changes the algorithm introduced at revision 210477
to fix a problem where the algorithm was producing incorrect code for
the VEX.256 encoded versions of horizontal add/sub.

For these cases, we now try to split the two 256-bit vectors into
128-bit chunks before emitting horizontal add/sub dag nodes.

Added a new test case into haddsub-2.ll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210545 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/haddsub-2.ll