aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-04-21 00:19:28 +0000
committerDan Gohman <gohman@apple.com>2010-04-21 00:19:28 +0000
commita51d382b60efe52265502a72967ea32d5d1c7492 (patch)
tree1ad414dcdda974caea3f61780d97e59c0cca0610 /lib
parent40e93ea86abc68a560ce74424e10ea3a1bf325dd (diff)
downloadexternal_llvm-a51d382b60efe52265502a72967ea32d5d1c7492.zip
external_llvm-a51d382b60efe52265502a72967ea32d5d1c7492.tar.gz
external_llvm-a51d382b60efe52265502a72967ea32d5d1c7492.tar.bz2
Add another variant of this test which found a place where
CodeGen's ComputeMaskedBits was being over-conservative when computing bits for an ADD. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101963 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 13f69c4..5031170 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1917,7 +1917,8 @@ void SelectionDAG::ComputeMaskedBits(SDValue Op, const APInt &Mask,
// Output known-0 bits are known if clear or set in both the low clear bits
// common to both LHS & RHS. For example, 8+(X<<3) is known to have the
// low 3 bits clear.
- APInt Mask2 = APInt::getLowBitsSet(BitWidth, Mask.countTrailingOnes());
+ APInt Mask2 = APInt::getLowBitsSet(BitWidth,
+ BitWidth - Mask.countLeadingZeros());
ComputeMaskedBits(Op.getOperand(0), Mask2, KnownZero2, KnownOne2, Depth+1);
assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?");
unsigned KnownZeroOut = KnownZero2.countTrailingOnes();