summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhou Sheng <zhousheng00@gmail.com>2007-03-08 15:15:18 +0000
committerZhou Sheng <zhousheng00@gmail.com>2007-03-08 15:15:18 +0000
commitd1eb3d593e7bf9c0d1315cce990120531c4830e7 (patch)
tree7938f7bbf2a1e770e361a0d9f3a8fa0cdddf9e9c
parentddf082082c7594f15be2ee9efc00db3a8a59deb0 (diff)
downloadbcm5719-llvm-d1eb3d593e7bf9c0d1315cce990120531c4830e7.tar.gz
bcm5719-llvm-d1eb3d593e7bf9c0d1315cce990120531c4830e7.zip
Fix a bug in function ComputeMaskedBits().
llvm-svn: 35027
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 02336e59c4c..79ad33697c7 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -677,7 +677,7 @@ static void ComputeMaskedBits(Value *V, APInt Mask, APInt& KnownZero,
const IntegerType *SrcTy = cast<IntegerType>(I->getOperand(0)->getType());
APInt NewBits(APInt::getAllOnesValue(BitWidth).shl(SrcTy->getBitWidth()));
- Mask &= SrcTy->getMask().zext(BitWidth);
+ Mask &= SrcTy->getMask().zextOrTrunc(BitWidth);
ComputeMaskedBits(I->getOperand(0), Mask, KnownZero, KnownOne, Depth+1);
assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
// The top bits are known to be zero.
@@ -689,7 +689,7 @@ static void ComputeMaskedBits(Value *V, APInt Mask, APInt& KnownZero,
const IntegerType *SrcTy = cast<IntegerType>(I->getOperand(0)->getType());
APInt NewBits(APInt::getAllOnesValue(BitWidth).shl(SrcTy->getBitWidth()));
- Mask &= SrcTy->getMask().zext(BitWidth);
+ Mask &= SrcTy->getMask().zextOrTrunc(BitWidth);
ComputeMaskedBits(I->getOperand(0), Mask, KnownZero, KnownOne, Depth+1);
assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
OpenPOWER on IntegriCloud