[PATCH] D44043: [DAGCombine] Remove AND in SETCC if we can prove they are unneeded

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 6 01:28:46 PST 2018


samparker added inline comments.


================
Comment at: include/llvm/CodeGen/SelectionDAG.h:1385
+  computeKnownBits(SDValue Op, KnownBits &Known,
+                   SmallPtrSetImpl<LoadSDNode *> *AnyToZeroExtLoads = nullptr,
+                   unsigned Depth = 0) const;
----------------
If you reorder the default parameters, you could reduce the number of changes needed in the backends.


================
Comment at: lib/CodeGen/SelectionDAG/TargetLowering.cpp:2682
+          LD->getAlignment(), LD->getMemOperand()->getFlags(), LD->getAAInfo());
+      DAG.ReplaceAllUsesOfValueWith(SDValue(LD, 0), Load);
+      if (LD == N0LHS.getNode())
----------------
Is this safe? Shouldn't the load be checked for a single use or that all the uses on your known bits path?


https://reviews.llvm.org/D44043





More information about the llvm-commits mailing list