aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2011-01-25 15:14:15 +0000
committerDuncan Sands <baldrick@free.fr>2011-01-25 15:14:15 +0000
commit227fba11ca168225d913d1cea94a05b883092e76 (patch)
treed6136703e166796c5838748f745ad92d120fe0be /lib
parentafde5188f2a97bd776e1349fe78801d67e187136 (diff)
downloadexternal_llvm-227fba11ca168225d913d1cea94a05b883092e76.zip
external_llvm-227fba11ca168225d913d1cea94a05b883092e76.tar.gz
external_llvm-227fba11ca168225d913d1cea94a05b883092e76.tar.bz2
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
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/ValueTracking.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp
index 98b4489..5320fa0 100644
--- a/lib/Analysis/ValueTracking.cpp
+++ b/lib/Analysis/ValueTracking.cpp
@@ -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.