diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp index 8e11bf3d451..24beee5a8be 100644 --- a/lib/Transforms/LevelRaise.cpp +++ b/lib/Transforms/LevelRaise.cpp @@ -528,8 +528,6 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) { Constant *ConstantCallSrc = 0; if (Constant *CS = dyn_cast(CI->getCalledValue())) ConstantCallSrc = CS; - else if (GlobalValue *GV = dyn_cast(CI->getCalledValue())) - ConstantCallSrc = ConstantPointerRef::get(GV); if (ConstantCallSrc) NewCast = ConstantExpr::getCast(ConstantCallSrc, NewPFunTy); @@ -537,10 +535,6 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) { NewCast = new CastInst(CI->getCalledValue(), NewPFunTy, CI->getCalledValue()->getName()+"_c",CI); - // Strip off unneeded CPR's. - if (ConstantPointerRef *CPR = dyn_cast(NewCast)) - NewCast = CPR->getValue(); - // Create a new call instruction... CallInst *NewCall = new CallInst(NewCast, std::vector(CI->op_begin()+1, CI->op_end()));