aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-03-05 23:09:40 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-03-05 23:09:40 +0000
commit049d08f5c9e4f9f5c71d8f8d08d846ba15f2ae99 (patch)
treed485f0f784f5e115de00b93339a29b8ff6495c4d /lib/Analysis
parentc3384c93c0e4c50da4ad093f08997507f9281c75 (diff)
Make sure we don't return bits outside the mask in ComputeMaskedBits. PR12189.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152066 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/ValueTracking.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp
index b5811f2e8a..b35e2074ac 100644
--- a/lib/Analysis/ValueTracking.cpp
+++ b/lib/Analysis/ValueTracking.cpp
@@ -691,8 +691,8 @@ void llvm::ComputeMaskedBits(Value *V, const APInt &Mask,
if (P->hasConstantValue() == P)
break;
- KnownZero = APInt::getAllOnesValue(BitWidth);
- KnownOne = APInt::getAllOnesValue(BitWidth);
+ KnownZero = Mask;
+ KnownOne = Mask;
for (unsigned i = 0, e = P->getNumIncomingValues(); i != e; ++i) {
// Skip direct self references.
if (P->getIncomingValue(i) == P) continue;