[InstCombine] SSE4A constant folding and conversion to shuffles.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 17 Oct 2015 11:40:05 +0000 (11:40 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 17 Oct 2015 11:40:05 +0000 (11:40 +0000)
commit576416a6905266d5d2e66c6b60f7fd198678b3ea
treeac406323927c8d6cacb1b12d9a340645eb133817
parent0dbe803c9e4a36f4bc3a7087cb2d48cc1a01826c
[InstCombine] SSE4A constant folding and conversion to shuffles.

This patch improves support for combining the SSE4A EXTRQ(I) and INSERTQ(I) intrinsics:

1 - Converts INSERTQ/EXTRQ calls to INSERTQI/EXTRQI if the 'bit index' and 'length' operands are constant
2 - Converts INSERTQI/EXTRQI calls to shufflevector if the bit index/length are both byte aligned (we can already lower shuffles to INSERTQI/EXTRQI if its useful)
3 - Constant folding support
4 - Add zeroinitializer handling

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250609 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCalls.cpp
test/Transforms/InstCombine/x86-sse4a.ll