diff --git a/llvm/include/llvm/Analysis/InlineOrder.h b/llvm/include/llvm/Analysis/InlineOrder.h --- a/llvm/include/llvm/Analysis/InlineOrder.h +++ b/llvm/include/llvm/Analysis/InlineOrder.h @@ -29,8 +29,6 @@ virtual T pop() = 0; - virtual const_reference front() = 0; - virtual void erase_if(function_ref Pred) = 0; bool empty() { return !size(); } diff --git a/llvm/lib/Analysis/InlineOrder.cpp b/llvm/lib/Analysis/InlineOrder.cpp --- a/llvm/lib/Analysis/InlineOrder.cpp +++ b/llvm/lib/Analysis/InlineOrder.cpp @@ -169,14 +169,6 @@ return Result; } - const_reference front() override { - assert(size() > 0); - adjust(); - - CallBase *CB = Heap.front(); - return *InlineHistoryMap.find(CB); - } - void erase_if(function_ref Pred) override { auto PredWrapper = [=](CallBase *CB) -> bool { return Pred(std::make_pair(CB, 0)); diff --git a/llvm/lib/Transforms/IPO/ModuleInliner.cpp b/llvm/lib/Transforms/IPO/ModuleInliner.cpp --- a/llvm/lib/Transforms/IPO/ModuleInliner.cpp +++ b/llvm/lib/Transforms/IPO/ModuleInliner.cpp @@ -182,22 +182,21 @@ // Loop forward over all of the calls. while (!Calls->empty()) { - Function &F = *Calls->front().first->getCaller(); - (void)F; + auto P = Calls->pop(); + CallBase *CB = P.first; + const int InlineHistoryID = P.second; + Function &F = *CB->getCaller(); + Function &Callee = *CB->getCalledFunction(); LLVM_DEBUG(dbgs() << "Inlining calls in: " << F.getName() << "\n" << " Function size: " << F.getInstructionCount() << "\n"); + (void)F; auto GetAssumptionCache = [&](Function &F) -> AssumptionCache & { return FAM.getResult(F); }; - auto P = Calls->pop(); - CallBase *CB = P.first; - const int InlineHistoryID = P.second; - Function &Callee = *CB->getCalledFunction(); - if (InlineHistoryID != -1 && inlineHistoryIncludes(&Callee, InlineHistoryID, InlineHistory)) { setInlineRemark(*CB, "recursive");