A few more cases of missing masking in ComputeMaskedBits; found by inspection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152070 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eli Friedman
2012-03-05 23:22:40 +00:00
parent bc978a60d9
commit 923bb4117a

View File

@@ -723,17 +723,17 @@ void llvm::ComputeMaskedBits(Value *V, const APInt &Mask,
// If this call is undefined for 0, the result will be less than 2^n.
if (II->getArgOperand(1) == ConstantInt::getTrue(II->getContext()))
LowBits -= 1;
KnownZero = APInt::getHighBitsSet(BitWidth, BitWidth - LowBits);
KnownZero = Mask & APInt::getHighBitsSet(BitWidth, BitWidth - LowBits);
break;
}
case Intrinsic::ctpop: {
unsigned LowBits = Log2_32(BitWidth)+1;
KnownZero = APInt::getHighBitsSet(BitWidth, BitWidth - LowBits);
KnownZero = Mask & APInt::getHighBitsSet(BitWidth, BitWidth - LowBits);
break;
}
case Intrinsic::x86_sse42_crc32_64_8:
case Intrinsic::x86_sse42_crc32_64_64:
KnownZero = APInt::getHighBitsSet(64, 32);
KnownZero = Mask & APInt::getHighBitsSet(64, 32);
break;
}
}