diff options
author | Chris Lattner <sabre@nondot.org> | 2009-11-26 22:08:06 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-11-26 22:08:06 +0000 |
commit | 998e25a1435befc650d05dc4573ca58883d3fac8 (patch) | |
tree | 58dcef4e2425f7bdd72425f2874f0b675dafe43d /lib/Transforms/Scalar/InstructionCombining.cpp | |
parent | 21f83a2f95c30b21398b6db0f80ac7eb0b4b672a (diff) |
fix crash on Transforms/InstCombine/intrinsics.ll introduced by r89970
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89972 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index f997d60a85..c7ab9df572 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -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]; |