[llvm] [SelectionDAG] Use computeForAddSub to prove that ISD::ADD is not 0 (PR #86453)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 24 20:39:57 PDT 2024
================
@@ -5405,7 +5405,14 @@ bool SelectionDAG::isKnownNeverZero(SDValue Op, unsigned Depth) const {
if (isKnownNeverZero(Op.getOperand(1), Depth + 1) ||
isKnownNeverZero(Op.getOperand(0), Depth + 1))
return true;
- // TODO: There are a lot more cases we can prove for add.
+ if (KnownBits::computeForAddSub(
----------------
topperc wrote:
Don't we call `computeKnownBits(Op, Depth).isNonZero();` after the switch in this function? That does the same thing as this in a more general way.
https://github.com/llvm/llvm-project/pull/86453
More information about the llvm-commits
mailing list