[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)
commit0d6d1f2b17693e1669781dcc4a0d0a6e1bb19e59
treeafb1cd91c0d40b40357ddb02fb07d28339b434b1
parent97ebc2362c506da8147c14218cbe395dea026442
[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

llvm-svn: 211890
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/vector-shuffle-combining.ll [new file with mode: 0644]