]> granicus.if.org Git - llvm/commit
[SelectionDAG] Add BITCAST handling to ComputeNumSignBits for splatted sign bits.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 18 Sep 2017 16:45:05 +0000 (16:45 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 18 Sep 2017 16:45:05 +0000 (16:45 +0000)
commit3632da7880a243806d45bf371af60a356b1f3b65
tree6334e0f4c75fec14866d4639e6e8e20baa2a3d2a
parent09f2a0775aea25154bd441bf942c4bd0777bc585
[SelectionDAG] Add BITCAST handling to ComputeNumSignBits for splatted sign bits.

For cases where we are BITCASTing to vectors of smaller elements, then if the entire source was a splatted sign (src's NumSignBits == SrcBitWidth) we can say that the dst's NumSignBit == DstBitWidth, as we're just splitting those sign bits across multiple elements.

We could generalize this but at the moment the only use case I have is to peek through bitcasts to vector comparison results.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313543 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
test/CodeGen/X86/bitcast-and-setcc-256.ll
test/CodeGen/X86/bitcast-and-setcc-512.ll
test/CodeGen/X86/cast-vsel.ll
test/CodeGen/X86/machine-cp.ll
test/CodeGen/X86/vector-compare-results.ll
test/CodeGen/X86/vsplit-and.ll