summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-05-07 00:35:55 +0000
committerDan Gohman <gohman@apple.com>2008-05-07 00:35:55 +0000
commit5a3eecdfd8e677396e381326182e310266a24ed1 (patch)
treea0081dae5ef19cbdc849befbb3b2e469acf37a53 /llvm/lib
parentcab93d58c3b87e986a796a453064e7faa67d038e (diff)
downloadbcm5719-llvm-5a3eecdfd8e677396e381326182e310266a24ed1.tar.gz
bcm5719-llvm-5a3eecdfd8e677396e381326182e310266a24ed1.zip
Fix a bug in the ComputeMaskedBits logic for multiply.
llvm-svn: 50793
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp4
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 3e75f7b3056..3d5a126df1b 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1244,8 +1244,8 @@ void SelectionDAG::ComputeMaskedBits(SDOperand Op, const APInt &Mask,
unsigned TrailZ = KnownZero.countTrailingOnes() +
KnownZero2.countTrailingOnes();
unsigned LeadZ = std::max(KnownZero.countLeadingOnes() +
- KnownZero2.countLeadingOnes() +
- 1, BitWidth) - BitWidth;
+ KnownZero2.countLeadingOnes(),
+ BitWidth) - BitWidth;
TrailZ = std::min(TrailZ, BitWidth);
LeadZ = std::min(LeadZ, BitWidth);
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 2afa6c51622..66d5326b9f3 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -767,8 +767,8 @@ void InstCombiner::ComputeMaskedBits(Value *V, const APInt &Mask,
unsigned TrailZ = KnownZero.countTrailingOnes() +
KnownZero2.countTrailingOnes();
unsigned LeadZ = std::max(KnownZero.countLeadingOnes() +
- KnownZero2.countLeadingOnes() +
- 1, BitWidth) - BitWidth;
+ KnownZero2.countLeadingOnes(),
+ BitWidth) - BitWidth;
TrailZ = std::min(TrailZ, BitWidth);
LeadZ = std::min(LeadZ, BitWidth);
OpenPOWER on IntegriCloud