[PATCH] D79003: [DAG] Add SimplifyDemandedVectorElts binop SimplifyMultipleUseDemandedBits handling

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 24 08:00:15 PDT 2020


spatel added a comment.

The code duplication is making me itchy. Add a helper like:

  if (simplifyDemandedVectorEltsBinop(Op, DemandedElts, TLO, Depth))
    return true;

That could include just the new block that's being created here, or we can dispatch directly on all of the binop cases in the top-level and then switch for the KnownZero/Undef/DemandedBits differences within there.



================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:2681
+    if (!DemandedElts.isAllOnesValue()) {
+      APInt DemandedBits = APInt::getAllOnesValue(VT.getScalarSizeInBits());
+      SDValue NewOp0 = SimplifyMultipleUseDemandedBits(
----------------
Is it correct to recycle the demanded bits on both operands here? That seems wrong for FP ops IIUC.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79003/new/

https://reviews.llvm.org/D79003





More information about the llvm-commits mailing list