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
llvm/lib/Transforms/Scalar
|
@ -9877,12 +9877,15 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
|
|||
const IntegerType *IT = cast<IntegerType>(II->getOperand(1)->getType());
|
||||
uint32_t BitWidth = IT->getBitWidth();
|
||||
APInt Mask = APInt::getSignBit(BitWidth);
|
||||
APInt LHSKnownZero, LHSKnownOne, RHSKnownZero, RHSKnownOne;
|
||||
APInt LHSKnownZero(BitWidth, 0);
|
||||
APInt LHSKnownOne(BitWidth, 0);
|
||||
ComputeMaskedBits(LHS, Mask, LHSKnownZero, LHSKnownOne);
|
||||
bool LHSKnownNegative = LHSKnownOne[BitWidth - 1];
|
||||
bool LHSKnownPositive = LHSKnownZero[BitWidth - 1];
|
||||
|
||||
if (LHSKnownNegative || LHSKnownPositive) {
|
||||
APInt RHSKnownZero(BitWidth, 0);
|
||||
APInt RHSKnownOne(BitWidth, 0);
|
||||
ComputeMaskedBits(RHS, Mask, RHSKnownZero, RHSKnownOne);
|
||||
bool RHSKnownNegative = RHSKnownOne[BitWidth - 1];
|
||||
bool RHSKnownPositive = RHSKnownZero[BitWidth - 1];
|
||||
|
|
Loading…
Reference in New Issue