aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-02-14 18:48:56 +0000
committerChris Lattner <sabre@nondot.org>2008-02-14 18:48:56 +0000
commit69946fdd7428f0a1ccc7defc7c06533817bbf80e (patch)
treea488c2f63001c7f8e981f39eaac0ba00b0129df1 /lib/CodeGen
parent78125047ccaff193ea0279332f5f2adae13177fb (diff)
downloadexternal_llvm-69946fdd7428f0a1ccc7defc7c06533817bbf80e.zip
external_llvm-69946fdd7428f0a1ccc7defc7c06533817bbf80e.tar.gz
external_llvm-69946fdd7428f0a1ccc7defc7c06533817bbf80e.tar.bz2
Fix a miscompilation from Dan's recent apintification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47128 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 76cf425..f8e1fea 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1437,12 +1437,10 @@ void SelectionDAG::ComputeMaskedBits(SDOperand Op, const APInt &Mask,
// We know that the top bits of C-X are clear if X contains less bits
// than C (i.e. no wrap-around can happen). For example, 20-X is
// positive if we can prove that X is >= 0 and < 16.
-
- // sign bit clear
if (CLHS->getAPIntValue().isNonNegative()) {
unsigned NLZ = (CLHS->getAPIntValue()+1).countLeadingZeros();
// NLZ can't be BitWidth with no sign bit
- APInt MaskV = APInt::getHighBitsSet(BitWidth, NLZ);
+ APInt MaskV = APInt::getHighBitsSet(BitWidth, NLZ+1);
ComputeMaskedBits(Op.getOperand(1), MaskV, KnownZero, KnownOne, Depth+1);
// If all of the MaskV bits are known to be zero, then we know the output