[PATCH] D55822: [SelectionDAG] Optional handling of UNDEF elements in matchBinaryPredicate

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 18 06:34:00 PST 2018


RKSimon created this revision.
RKSimon added reviewers: andreadb, spatel, craig.topper, efriedma.

Now that SimplifyDemandedBits/SimplifyDemandedVectorElts is simplifying vector elements, we're seeing more constant BUILD_VECTOR containing undefs.

This patch provides opt-in support for UNDEF elements in matchBinaryPredicate, passing NULL instead of the result ConstantSDNode* argument.

I've updated the (or (and X, c1), c2) -> (and (or X, c2), c1|c2) fold to demonstrate its use, which I believe is safe for undef cases.


Repository:
  rL LLVM

https://reviews.llvm.org/D55822

Files:
  include/llvm/CodeGen/SelectionDAGNodes.h
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  test/CodeGen/X86/known-bits-vector.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55822.178659.patch
Type: text/x-patch
Size: 4924 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181218/21731b42/attachment.bin>


More information about the llvm-commits mailing list