aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 02336e59c4..79ad33697c 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/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?");