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

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 07:27:20 PDT 2020


RKSimon added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:2646-2649
     KnownUndef = getKnownUndefForVectorBinop(Op, TLO.DAG, UndefLHS, UndefRHS);
+
+    // Attempt to avoid multi-use ops if we don't need anything from them.
+    if (!DemandedElts.isAllOnesValue()) {
----------------
lebedev.ri wrote:
> Just wondering, should we not demand elts that are `KnownUndef`?
That's a good idea - decent tests might be tricky but should be doable. A slight thing to watch out for is KnownUndef/KnownZero bits are only guaranteed to be correct for demanded elts.

Would it be OK just to add this as a TODO comment for now? It might need some investigation (and improvements to KnownUndef/KnownZero emission which isn't great yet as we don't use it enough).


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