diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 6ade82e1bd7..d53cdbf87df 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -2456,10 +2456,8 @@ Instruction *InstCombiner::visitCallSite(CallSite CS) { bool InstCombiner::transformConstExprCastCall(CallSite CS) { if (!isa(CS.getCalledValue())) return false; ConstantExpr *CE = cast(CS.getCalledValue()); - if (CE->getOpcode() != Instruction::Cast || - !isa(CE->getOperand(0))) + if (CE->getOpcode() != Instruction::Cast || !isa(CE->getOperand(0))) return false; - if (!isa(CE->getOperand(0))) return false; Function *Callee = cast(CE->getOperand(0)); Instruction *Caller = CS.getInstruction(); @@ -2809,8 +2807,7 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) { Indices.push_back(cast(*I)); if (I == E) { // If they are all constants... - Constant *CE = - ConstantExpr::getGetElementPtr(GV, Indices); + Constant *CE = ConstantExpr::getGetElementPtr(GV, Indices); // Replace all uses of the GEP with the new constexpr... return ReplaceInstUsesWith(GEP, CE); @@ -2977,8 +2974,6 @@ Instruction *InstCombiner::visitLoadInst(LoadInst &LI) { if (Constant *C = dyn_cast(Op)) if (C->isNullValue()) // load null -> 0 return ReplaceInstUsesWith(LI, Constant::getNullValue(LI.getType())); - else if (isa(C)) - Op = C; // Instcombine load (constant global) into the value loaded... if (GlobalVariable *GV = dyn_cast(Op))