summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
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
commitad33d33719bb5676bfbd318d914ae06c33862b0d (patch)
tree9f1ed003498df3172a8605716fc8ebd83047718a /llvm/lib/CodeGen
parentb722993cff6f624773bf8d3c8730d583ce38ec4b (diff)
downloadbcm5719-llvm-ad33d33719bb5676bfbd318d914ae06c33862b0d.tar.gz
bcm5719-llvm-ad33d33719bb5676bfbd318d914ae06c33862b0d.zip
Add another variant of this test which found a place where
CodeGen's ComputeMaskedBits was being over-conservative when computing bits for an ADD. llvm-svn: 101963
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 13f69c4e817..5031170946d 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/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();
OpenPOWER on IntegriCloud