[PATCH] D24253: [SelectionDAG] Add basic vector support to computeKnownBits and SimplifyDemandedBits

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 7 09:56:29 PDT 2016


RKSimon updated this revision to Diff 70550.
RKSimon added a comment.

There aren't that many cases that can use vectors that call SelectionDAG::computeKnownBits - the AMDGPU cases already test the ZEXT_LOAD example.

I've added support to DAGCombiner::visitAND to work with splatted constant vector values as well which has exposed one more test case, if you'd prefer for this to be put up for review separately then just say.

SelectionDAG::computeKnownBits like much of DAGCombiner has been coded to work on individual scalar elements (see all the references to getScalarType().getSizeInBits()), its not something that can be easily reworked so that APInt represents every bit of every vector element.

Some vectors already work with SelectionDAG::computeKnownBits (e.g. zext returns the KnownZero bits as its the same for every element).

I agree we want to have full per-element vector support in the long term but its not something that this patch makes any more difficult.


Repository:
  rL LLVM

https://reviews.llvm.org/D24253

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  lib/CodeGen/SelectionDAG/TargetLowering.cpp
  test/CodeGen/AMDGPU/load-constant-i16.ll
  test/CodeGen/AMDGPU/load-global-i16.ll
  test/CodeGen/X86/combine-and.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24253.70550.patch
Type: text/x-patch
Size: 10615 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160907/4a682a3d/attachment.bin>


More information about the llvm-commits mailing list