[PATCH] D134121: [ModuleInliner] Remove InlineOrder::front (NFC)
Kazu Hirata via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 18 08:49:53 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd3b95ecc98d2: [ModuleInliner] Remove InlineOrder::front (NFC) (authored by kazu).
Changed prior to commit:
https://reviews.llvm.org/D134121?vs=461045&id=461078#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134121/new/
https://reviews.llvm.org/D134121
Files:
llvm/include/llvm/Analysis/InlineOrder.h
llvm/lib/Analysis/InlineOrder.cpp
llvm/lib/Transforms/IPO/ModuleInliner.cpp
Index: llvm/lib/Transforms/IPO/ModuleInliner.cpp
===================================================================
--- llvm/lib/Transforms/IPO/ModuleInliner.cpp
+++ 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<AssumptionAnalysis>(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");
Index: llvm/lib/Analysis/InlineOrder.cpp
===================================================================
--- llvm/lib/Analysis/InlineOrder.cpp
+++ 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<bool(T)> Pred) override {
auto PredWrapper = [=](CallBase *CB) -> bool {
return Pred(std::make_pair(CB, 0));
Index: llvm/include/llvm/Analysis/InlineOrder.h
===================================================================
--- llvm/include/llvm/Analysis/InlineOrder.h
+++ 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<bool(T)> Pred) = 0;
bool empty() { return !size(); }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134121.461078.patch
Type: text/x-patch
Size: 2128 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220918/a94222f7/attachment-0001.bin>
More information about the llvm-commits
mailing list