diff options
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineCompares.cpp')
| -rw-r--r-- | lib/Transforms/InstCombine/InstCombineCompares.cpp | 22 | 
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCompares.cpp b/lib/Transforms/InstCombine/InstCombineCompares.cpp index 72af80fbe1de..518af7477d0e 100644 --- a/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -1988,7 +1988,7 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) {    // values.  If the ptr->ptr cast can be stripped off both arguments, we do so    // now.    if (BitCastInst *CI = dyn_cast<BitCastInst>(Op0)) { -    if (isa<PointerType>(Op0->getType()) &&  +    if (Op0->getType()->isPointerTy() &&           (isa<Constant>(Op1) || isa<BitCastInst>(Op1))) {         // We keep moving the cast from the left operand over to the right        // operand, where it can often be eliminated completely. @@ -2458,17 +2458,17 @@ Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) {            return SelectInst::Create(LHSI->getOperand(0), Op1, Op2);          break;        } -    case Instruction::Load: -      if (GetElementPtrInst *GEP = -          dyn_cast<GetElementPtrInst>(LHSI->getOperand(0))) { -        if (GlobalVariable *GV = dyn_cast<GlobalVariable>(GEP->getOperand(0))) -          if (GV->isConstant() && GV->hasDefinitiveInitializer() && -              !cast<LoadInst>(LHSI)->isVolatile()) -            if (Instruction *Res = FoldCmpLoadFromIndexedGlobal(GEP, GV, I)) -              return Res; +      case Instruction::Load: +        if (GetElementPtrInst *GEP = +            dyn_cast<GetElementPtrInst>(LHSI->getOperand(0))) { +          if (GlobalVariable *GV = dyn_cast<GlobalVariable>(GEP->getOperand(0))) +            if (GV->isConstant() && GV->hasDefinitiveInitializer() && +                !cast<LoadInst>(LHSI)->isVolatile()) +              if (Instruction *Res = FoldCmpLoadFromIndexedGlobal(GEP, GV, I)) +                return Res; +        } +        break;        } -      break; -    }    }    return Changed ? &I : 0;  | 
