OSDN Git Service

[X86][SSE] Improve combineLogicBlendIntoPBLENDV to use general masks.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 8 May 2017 14:16:39 +0000 (14:16 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 8 May 2017 14:16:39 +0000 (14:16 +0000)
commit844a30564efae4411785aba6363aad5513edffd9
tree78b3480849ff6e46cf71e56dd1c9229e85f291e7
parent73e28f8b2b26ae111958a0dc5cfca4f479da8c8e
[X86][SSE] Improve combineLogicBlendIntoPBLENDV to use general masks.

Currently combineLogicBlendIntoPBLENDV can only match ASHR to detect sign splatting of a bit mask, this patch generalises this to use computeNumSignBits instead.

This is a first step in several things we can do to improve PBLENDV support:

 * Better matching of X86ISD::ANDNP patterns.
 * Handle floating point cases.
 * Better vector and bitcast support in computeNumSignBits.
 * Recognise that PBLENDV only uses the sign bit of the mask, we should be able strip away sign splats (ASHR, PCMPGT isNeg tests etc.).

Differential Revision: https://reviews.llvm.org/D32953

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302424 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/cast-vsel.ll
test/CodeGen/X86/pr32907.ll
test/CodeGen/X86/vselect-pcmp.ll