[x86] Teach the target-specific combining how to aggressively fold
authorChandler Carruth <chandlerc@gmail.com>
Fri, 27 Jun 2014 11:34:40 +0000 (11:34 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 27 Jun 2014 11:34:40 +0000 (11:34 +0000)
commit4363b0729b2b2aa50949ac9fb3af5ced0240898f
treea79307489e3443b447e9a302f14e4d4bbbeb17f4
parentf91161874e516621aa9c1734391c5bd01d9d4e6d
[x86] Teach the target-specific combining how to aggressively fold
half-shuffles, even looking through intervening instructions in a chain.

Summary:
This doesn't happen to show up with any test cases I've found for the current
shuffle lowering, but previous attempts would benefit from this and it seems
generally useful. I've tested it directly using intrinsics, which also shows
that it will work with hand vectorized code as well.

Note that even though pshufd isn't directly used in these tests, it gets
exercised because we combine some of the half shuffles into a pshufd
first, and then merge them.

Differential Revision: http://reviews.llvm.org/D4291

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211890 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/vector-shuffle-combining.ll [new file with mode: 0644]