Fix a problem in my patch yesterday, causing a miscompilation of 176.gcc
authorChris Lattner <sabre@nondot.org>
Wed, 8 Feb 2006 01:20:23 +0000 (01:20 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 8 Feb 2006 01:20:23 +0000 (01:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26045 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index 6058338531746f2e69c8c23a26344c16e270fd9a..1958e5647e1ea456792af49c4ff8c4b96c7a4bf4 100644 (file)
@@ -464,7 +464,7 @@ static uint64_t ComputeMaskedNonZeroBits(Value *V, uint64_t Mask,
       // (shl X, C1) & C2 == 0   iff   (X & C2 >>u C1) == 0
       if (ConstantUInt *SA = dyn_cast<ConstantUInt>(I->getOperand(1)))
         return ComputeMaskedNonZeroBits(I->getOperand(0),Mask >> SA->getValue(), 
-                                        Depth+1);
+                                        Depth+1) << SA->getValue();
       break;
     case Instruction::Shr:
       // (ushr X, C1) & C2 == 0   iff  (-1 >> C1) & C2 == 0
@@ -472,7 +472,8 @@ static uint64_t ComputeMaskedNonZeroBits(Value *V, uint64_t Mask,
         if (I->getType()->isUnsigned()) {
           Mask <<= SA->getValue();
           Mask &= I->getType()->getIntegralTypeMask();
-          return ComputeMaskedNonZeroBits(I->getOperand(0), Mask, Depth+1);
+          return ComputeMaskedNonZeroBits(I->getOperand(0), Mask, Depth+1)
+                      >> SA->getValue();
         }
       break;
     }