fix a subtle bug that caused an MSVC warning. Thanks to Jeffc for pointing this...
authorChris Lattner <sabre@nondot.org>
Mon, 5 Mar 2007 00:11:19 +0000 (00:11 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 5 Mar 2007 00:11:19 +0000 (00:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34920 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index 028fa734d3ddfb5a979cc217723309ae03dd3828..e8de969c0effe9b6a44799f449fa4082d4691696 100644 (file)
@@ -5559,10 +5559,11 @@ Instruction *InstCombiner::FoldShiftByConstant(Value *Op0, ConstantInt *Op1,
           
           // Turn (Y + ((X >> C) & CC)) << C  ->  ((X & (CC << C)) + (Y << C))
           Value *Op0BOOp1 = Op0BO->getOperand(1);
-          if (isLeftShift && Op0BOOp1->hasOneUse() && V2 == Op1 &&
+          if (isLeftShift && Op0BOOp1->hasOneUse() &&
               match(Op0BOOp1, 
                     m_And(m_Shr(m_Value(V1), m_Value(V2)),m_ConstantInt(CC))) &&
-              cast<BinaryOperator>(Op0BOOp1)->getOperand(0)-> hasOneUse()) {
+              cast<BinaryOperator>(Op0BOOp1)->getOperand(0)->hasOneUse() &&
+              V2 == Op1) {
             Instruction *YS = BinaryOperator::createShl(
                                                      Op0BO->getOperand(0), Op1,
                                                      Op0BO->getName());