Simplify the code.
authorZhou Sheng <zhousheng00@gmail.com>
Fri, 23 Mar 2007 02:39:25 +0000 (02:39 +0000)
committerZhou Sheng <zhousheng00@gmail.com>
Fri, 23 Mar 2007 02:39:25 +0000 (02:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35275 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index ddbb607d450cd944826dd0c090e25c20a0323487..6d4a8ddb265cbd1bf69b3458e3761285a5162cef 100644 (file)
@@ -6801,7 +6801,7 @@ static bool CanEvaluateInDifferentType(Value *V, const IntegerType *Ty,
     // already zeros.
     if (ConstantInt *CI = dyn_cast<ConstantInt>(I->getOperand(1))) {
       uint32_t BitWidth = OrigTy->getBitWidth();
-      if (Ty->getBitWidth() < OrigTy->getBitWidth() &&
+      if (Ty->getBitWidth() < BitWidth &&
           MaskedValueIsZero(I->getOperand(0),
             APInt::getAllOnesValue(BitWidth) & 
          APInt::getAllOnesValue(Ty->getBitWidth()).zextOrTrunc(BitWidth).flip())