aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-02-08 01:20:23 +0000
committerChris Lattner <sabre@nondot.org>2006-02-08 01:20:23 +0000
commit62d1ade893b3ed93ed64cc5797a9e8117e197fa9 (patch)
treeaf347522da5d3f9388c23062746e9857c40a2f8f /lib/Transforms
parent5ada370f42a805f5fd585ac97aae82caea62a5a0 (diff)
downloadexternal_llvm-62d1ade893b3ed93ed64cc5797a9e8117e197fa9.zip
external_llvm-62d1ade893b3ed93ed64cc5797a9e8117e197fa9.tar.gz
external_llvm-62d1ade893b3ed93ed64cc5797a9e8117e197fa9.tar.bz2
Fix a problem in my patch yesterday, causing a miscompilation of 176.gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26045 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 6058338..1958e56 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -464,7 +464,7 @@ static uint64_t ComputeMaskedNonZeroBits(Value *V, uint64_t Mask,
// (shl X, C1) & C2 == 0 iff (X & C2 >>u C1) == 0
if (ConstantUInt *SA = dyn_cast<ConstantUInt>(I->getOperand(1)))
return ComputeMaskedNonZeroBits(I->getOperand(0),Mask >> SA->getValue(),
- Depth+1);
+ Depth+1) << SA->getValue();
break;
case Instruction::Shr:
// (ushr X, C1) & C2 == 0 iff (-1 >> C1) & C2 == 0
@@ -472,7 +472,8 @@ static uint64_t ComputeMaskedNonZeroBits(Value *V, uint64_t Mask,
if (I->getType()->isUnsigned()) {
Mask <<= SA->getValue();
Mask &= I->getType()->getIntegralTypeMask();
- return ComputeMaskedNonZeroBits(I->getOperand(0), Mask, Depth+1);
+ return ComputeMaskedNonZeroBits(I->getOperand(0), Mask, Depth+1)
+ >> SA->getValue();
}
break;
}