diff options
| author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-03-09 22:43:37 +0000 |
|---|---|---|
| committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-03-09 22:43:37 +0000 |
| commit | 8fcf1d5da18e76fd599964b610efab799b18257a (patch) | |
| tree | ef440ea93ba1f8de07a6663f8265526cd0cebee5 /lib/Transforms/IPO | |
| parent | b6c1eccaf3026398325efd7ccb7dbdeae543f281 (diff) | |
| download | external_llvm-8fcf1d5da18e76fd599964b610efab799b18257a.zip external_llvm-8fcf1d5da18e76fd599964b610efab799b18257a.tar.gz external_llvm-8fcf1d5da18e76fd599964b610efab799b18257a.tar.bz2 | |
Revert r98089, it was breaking a clang test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98094 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO')
| -rw-r--r-- | lib/Transforms/IPO/InlineAlways.cpp | 5 | ||||
| -rw-r--r-- | lib/Transforms/IPO/InlineSimple.cpp | 3 | ||||
| -rw-r--r-- | lib/Transforms/IPO/Inliner.cpp | 10 |
3 files changed, 6 insertions, 12 deletions
diff --git a/lib/Transforms/IPO/InlineAlways.cpp b/lib/Transforms/IPO/InlineAlways.cpp index bc8028c..f11ecae 100644 --- a/lib/Transforms/IPO/InlineAlways.cpp +++ b/lib/Transforms/IPO/InlineAlways.cpp @@ -45,10 +45,7 @@ namespace { return CA.getInlineFudgeFactor(CS); } void resetCachedCostInfo(Function *Caller) { - CA.resetCachedCostInfo(Caller); - } - void growCachedCostInfo(Function* Caller, Function* Callee) { - CA.growCachedCostInfo(Caller, Callee); + return CA.resetCachedCostInfo(Caller); } virtual bool doFinalization(CallGraph &CG) { return removeDeadFunctions(CG, &NeverInline); diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp index 46cf4b2..598043d 100644 --- a/lib/Transforms/IPO/InlineSimple.cpp +++ b/lib/Transforms/IPO/InlineSimple.cpp @@ -45,9 +45,6 @@ namespace { void resetCachedCostInfo(Function *Caller) { CA.resetCachedCostInfo(Caller); } - void growCachedCostInfo(Function* Caller, Function* Callee) { - CA.growCachedCostInfo(Caller, Callee); - } virtual bool doInitialization(CallGraph &CG); }; } diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp index 03ec72c..3d0309f 100644 --- a/lib/Transforms/IPO/Inliner.cpp +++ b/lib/Transforms/IPO/Inliner.cpp @@ -369,8 +369,6 @@ bool Inliner::runOnSCC(std::vector<CallGraphNode*> &SCC) { CG[Caller]->removeCallEdgeFor(CS); CS.getInstruction()->eraseFromParent(); ++NumCallsDeleted; - // Update the cached cost info with the missing call - growCachedCostInfo(Caller, NULL); } else { // We can only inline direct calls to non-declarations. if (Callee == 0 || Callee->isDeclaration()) continue; @@ -384,9 +382,6 @@ bool Inliner::runOnSCC(std::vector<CallGraphNode*> &SCC) { if (!InlineCallIfPossible(CS, CG, TD, InlinedArrayAllocas)) continue; ++NumInlined; - - // Update the cached cost info with the inlined call. - growCachedCostInfo(Caller, Callee); } // If we inlined or deleted the last possible call site to the function, @@ -412,6 +407,11 @@ bool Inliner::runOnSCC(std::vector<CallGraphNode*> &SCC) { delete CG.removeFunctionFromModule(CalleeNode); ++NumDeleted; } + + // Remove any cached cost info for this caller, as inlining the + // callee has increased the size of the caller (which may be the + // same as the callee). + resetCachedCostInfo(Caller); // Remove this call site from the list. If possible, use // swap/pop_back for efficiency, but do not use it if doing so would |
