[X86, AVX] instcombine common cases of vperm2* intrinsics into shuffles
authorSanjay Patel <spatel@rotateright.com>
Fri, 20 Mar 2015 21:47:56 +0000 (21:47 +0000)
committerSanjay Patel <spatel@rotateright.com>
Fri, 20 Mar 2015 21:47:56 +0000 (21:47 +0000)
commitccf5f24b7b907680bdcfb19104cae78a92580682
tree7881b1b31a6120b5097b06b57279e3f97e03288b
parent3170e5620e463b20688bc629bde08c5ca554ea11
[X86, AVX] instcombine common cases of vperm2* intrinsics into shuffles

vperm2* intrinsics are just shuffles.
In a few special cases, they're not even shuffles.

Optimizing intrinsics in InstCombine is better than
handling this in the front-end for at least two reasons:

1. Optimizing custom-written SSE intrinsic code at -O0 makes vector coders
   really angry (and so I have regrets about some patches from last week).

2. Doing mask conversion logic in header files is hard to write and
   subsequently read.

There are a couple of TODOs in this patch to complete this optimization.

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

llvm-svn: 232852
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/test/Transforms/InstCombine/x86-vperm2.ll [new file with mode: 0644]