[PATCH] D79003: [DAG] Add SimplifyDemandedVectorElts binop SimplifyMultipleUseDemandedBits handling
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 4 07:59:57 PDT 2020
lebedev.ri 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()) {
----------------
RKSimon wrote:
> 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).
> That's a good idea - decent tests might be tricky but should be doable.
Aha. That //might// even be more generic than this if-block.
> Would it be OK just to add this as a TODO comment for now?
Yes, absolutely.
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