forked from OSchip/llvm-project
fix crash on Transforms/InstCombine/intrinsics.ll introduced by r89970
llvm-svn: 89972
This commit is contained in:
parent
a73ecf0b00
commit
a5bc618a91
|
@ -9877,12 +9877,15 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
|
||||||
const IntegerType *IT = cast<IntegerType>(II->getOperand(1)->getType());
|
const IntegerType *IT = cast<IntegerType>(II->getOperand(1)->getType());
|
||||||
uint32_t BitWidth = IT->getBitWidth();
|
uint32_t BitWidth = IT->getBitWidth();
|
||||||
APInt Mask = APInt::getSignBit(BitWidth);
|
APInt Mask = APInt::getSignBit(BitWidth);
|
||||||
APInt LHSKnownZero, LHSKnownOne, RHSKnownZero, RHSKnownOne;
|
APInt LHSKnownZero(BitWidth, 0);
|
||||||
|
APInt LHSKnownOne(BitWidth, 0);
|
||||||
ComputeMaskedBits(LHS, Mask, LHSKnownZero, LHSKnownOne);
|
ComputeMaskedBits(LHS, Mask, LHSKnownZero, LHSKnownOne);
|
||||||
bool LHSKnownNegative = LHSKnownOne[BitWidth - 1];
|
bool LHSKnownNegative = LHSKnownOne[BitWidth - 1];
|
||||||
bool LHSKnownPositive = LHSKnownZero[BitWidth - 1];
|
bool LHSKnownPositive = LHSKnownZero[BitWidth - 1];
|
||||||
|
|
||||||
if (LHSKnownNegative || LHSKnownPositive) {
|
if (LHSKnownNegative || LHSKnownPositive) {
|
||||||
|
APInt RHSKnownZero(BitWidth, 0);
|
||||||
|
APInt RHSKnownOne(BitWidth, 0);
|
||||||
ComputeMaskedBits(RHS, Mask, RHSKnownZero, RHSKnownOne);
|
ComputeMaskedBits(RHS, Mask, RHSKnownZero, RHSKnownOne);
|
||||||
bool RHSKnownNegative = RHSKnownOne[BitWidth - 1];
|
bool RHSKnownNegative = RHSKnownOne[BitWidth - 1];
|
||||||
bool RHSKnownPositive = RHSKnownZero[BitWidth - 1];
|
bool RHSKnownPositive = RHSKnownZero[BitWidth - 1];
|
||||||
|
|
Loading…
Reference in New Issue