[llvm-commits] [llvm] r89972 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp

Chris Lattner sabre at nondot.org
Thu Nov 26 14:08:06 PST 2009


Author: lattner
Date: Thu Nov 26 16:08:06 2009
New Revision: 89972

URL: http://llvm.org/viewvc/llvm-project?rev=89972&view=rev
Log:
fix crash on Transforms/InstCombine/intrinsics.ll introduced by r89970 

Modified:
    llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=89972&r1=89971&r2=89972&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Thu Nov 26 16:08:06 2009
@@ -9877,12 +9877,15 @@
     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];





More information about the llvm-commits mailing list