OSDN Git Service

[TargetLowering] check for sign-bit comparisons in SimplifyDemandedBits
authorSanjay Patel <spatel@rotateright.com>
Sat, 11 Feb 2017 18:01:55 +0000 (18:01 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sat, 11 Feb 2017 18:01:55 +0000 (18:01 +0000)
commit57101fca7a5d474d8a9be8f5a426e835f7594af2
tree8bdfb28455d0c8366d3385ccc764a388b86713b0
parent561536223de583bcb6a297393e7e960f8f42717a
[TargetLowering] check for sign-bit comparisons in SimplifyDemandedBits

I don't know if anything other than x86 vectors is affected by this change, but this may allow
us to remove target-specific intrinsics for blendv* (vector selects). The simplification arises
from the fact that blendv* instructions only use the sign-bit when deciding which vector element
to choose for the destination vector. The mechanism to fold VSELECT into SHRUNKBLEND nodes already
exists in x86 lowering; this demanded bits change just enables the transform to fire more often.

The original motivation starts with a bug for DSE of masked stores that seems completely unrelated,
but I've explained the likely steps in this series here:
https://llvm.org/bugs/show_bug.cgi?id=11210

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294863 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/TargetLowering.cpp
test/CodeGen/X86/vselect-pcmp.ll