[InstCombine] SSE/AVX vector shifts demanded shift amount bits
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 13 Aug 2015 07:39:03 +0000 (07:39 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 13 Aug 2015 07:39:03 +0000 (07:39 +0000)
commit335fc618739df457dd0fd1bf40c2e03f3f224f48
tree81da1927491ece38e97e2831b963320be582ead4
parentd4177b27058cfed2320f3ea1bf7ac2552f5a3e71
[InstCombine] SSE/AVX vector shifts demanded shift amount bits

Most SSE/AVX (non-constant) vector shift instructions only use the lower 64-bits of the 128-bit shift amount vector operand, this patch calls SimplifyDemandedVectorElts to optimize for this.

I had to refactor some of my recent InstCombiner work on the vector shifts to avoid quite a bit of duplicate code, it means that SimplifyX86immshift now (re)decodes the type of shift.

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

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