In which I discover that zero+zero is zero, d'oh!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124188 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan Sands
2011-01-25 15:14:15 +00:00
parent afde5188f2
commit 227fba11ca
2 changed files with 17 additions and 4 deletions

View File

@ -740,10 +740,10 @@ bool llvm::isKnownNonZero(Value *V, const TargetData *TD, unsigned Depth) {
ComputeSignBit(Y, YKnownNonNegative, YKnownNegative, TD, Depth);
// If X and Y are both non-negative (as signed values) then their sum is not
// zero.
// zero unless both X and Y are zero.
if (XKnownNonNegative && YKnownNonNegative)
return false;
// return true;
if (isKnownNonZero(X, TD, Depth) || isKnownNonZero(Y, TD, Depth))
return true;
// If X and Y are both negative (as signed values) then their sum is not
// zero unless both X and Y equal INT_MIN.