[PATCH] D37849: [SelectionDAG] Add BITCAST handling to ComputeNumSignBits for splatted sign bits.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 14 06:19:04 PDT 2017


RKSimon created this revision.

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.

psubus.ll - @spatel I think you've encountered the PAND -> PBLENDVB+ZERO issue before - where is the best place to fix it? Do we just need to improve VSELECT/SHRUNKBLEND handling?


Repository:
  rL LLVM

https://reviews.llvm.org/D37849

Files:
  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/psubus.ll
  test/CodeGen/X86/vector-compare-results.ll
  test/CodeGen/X86/vsplit-and.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37849.115206.patch
Type: text/x-patch
Size: 116108 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170914/de23a223/attachment.bin>


More information about the llvm-commits mailing list