summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-26 22:08:06 +0000
committerChris Lattner <sabre@nondot.org>2009-11-26 22:08:06 +0000
commita5bc618a916dec01739599a780beebcdd380a4aa (patch)
treee9567853f02a167bb37cde7d47bd9f83df7e66fa /llvm/lib/Transforms/Scalar/InstructionCombining.cpp
parenta73ecf0b005bf15f635730aede5abd83a521a467 (diff)
downloadbcm5719-llvm-a5bc618a916dec01739599a780beebcdd380a4aa.tar.gz
bcm5719-llvm-a5bc618a916dec01739599a780beebcdd380a4aa.zip
fix crash on Transforms/InstCombine/intrinsics.ll introduced by r89970
llvm-svn: 89972
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index f997d60a85e..c7ab9df5722 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/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];
OpenPOWER on IntegriCloud