summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-03-31 12:48:08 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-03-31 12:48:08 +0000
commitedd2826f3e287c675f6e696b01eb60bd17f5efc1 (patch)
tree31a0d03df1276f141cd40d1e2f1a38d4845a6fc1
parent0539c071eaf0153aa5b2d2bbfd06c58651b55605 (diff)
downloadbcm5719-llvm-edd2826f3e287c675f6e696b01eb60bd17f5efc1.tar.gz
bcm5719-llvm-edd2826f3e287c675f6e696b01eb60bd17f5efc1.zip
Remove a bunch of empty, dead, and no-op methods from all of these
interfaces. These methods were used in the old inline cost system where there was a persistent cache that had to be updated, invalidated, and cleared. We're now doing more direct computations that don't require this intricate dance. Even if we resume some level of caching, it would almost certainly have a simpler and more narrow interface than this. llvm-svn: 153813
-rw-r--r--llvm/include/llvm/Analysis/InlineCost.h12
-rw-r--r--llvm/include/llvm/Transforms/IPO/InlinerPass.h9
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp10
-rw-r--r--llvm/lib/Transforms/IPO/InlineAlways.cpp9
-rw-r--r--llvm/lib/Transforms/IPO/InlineSimple.cpp9
-rw-r--r--llvm/lib/Transforms/IPO/Inliner.cpp8
6 files changed, 0 insertions, 57 deletions
diff --git a/llvm/include/llvm/Analysis/InlineCost.h b/llvm/include/llvm/Analysis/InlineCost.h
index c523890472a..34162050864 100644
--- a/llvm/include/llvm/Analysis/InlineCost.h
+++ b/llvm/include/llvm/Analysis/InlineCost.h
@@ -122,18 +122,6 @@ namespace llvm {
/// bound the computation necessary to determine whether the cost is
/// sufficiently low to warrant inlining.
InlineCost getInlineCost(CallSite CS, int Threshold);
-
- /// resetCachedFunctionInfo - erase any cached cost info for this function.
- void resetCachedCostInfo(Function* Caller) {
- }
-
- /// growCachedCostInfo - update the cached cost info for Caller after Callee
- /// has been inlined. If Callee is NULL it means a dead call has been
- /// eliminated.
- void growCachedCostInfo(Function* Caller, Function* Callee);
-
- /// clear - empty the cache of inline costs
- void clear();
};
/// callIsSmall - If a call is likely to lower to a single target instruction,
diff --git a/llvm/include/llvm/Transforms/IPO/InlinerPass.h b/llvm/include/llvm/Transforms/IPO/InlinerPass.h
index bdc02fff73b..7c3cfc87015 100644
--- a/llvm/include/llvm/Transforms/IPO/InlinerPass.h
+++ b/llvm/include/llvm/Transforms/IPO/InlinerPass.h
@@ -65,15 +65,6 @@ struct Inliner : public CallGraphSCCPass {
///
virtual InlineCost getInlineCost(CallSite CS) = 0;
- /// resetCachedCostInfo - erase any cached cost data from the derived class.
- /// If the derived class has no such data this can be empty.
- ///
- virtual void resetCachedCostInfo(Function* Caller) = 0;
-
- /// growCachedCostInfo - update the cached cost info for Caller after Callee
- /// has been inlined.
- virtual void growCachedCostInfo(Function *Caller, Function *Callee) = 0;
-
/// removeDeadFunctions - Remove dead functions.
///
/// This also includes a hack in the form of the 'AlwaysInlineOnly' flag
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index bc6c1687fd7..3ad36f16ad9 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -1012,13 +1012,3 @@ InlineCost InlineCostAnalyzer::getInlineCost(CallSite CS, int Threshold) {
return llvm::InlineCost::get(CA.getCost(), CA.getThreshold());
}
-
-/// growCachedCostInfo - update the cached cost info for Caller after Callee has
-/// been inlined.
-void
-InlineCostAnalyzer::growCachedCostInfo(Function *Caller, Function *Callee) {
-}
-
-/// clear - empty the cache of inline costs
-void InlineCostAnalyzer::clear() {
-}
diff --git a/llvm/lib/Transforms/IPO/InlineAlways.cpp b/llvm/lib/Transforms/IPO/InlineAlways.cpp
index ef7e45235e3..4e666fb5456 100644
--- a/llvm/lib/Transforms/IPO/InlineAlways.cpp
+++ b/llvm/lib/Transforms/IPO/InlineAlways.cpp
@@ -61,19 +61,10 @@ namespace {
// indirectbr.
return CA.getInlineCost(CS, getInlineThreshold(CS));
}
- void resetCachedCostInfo(Function *Caller) {
- CA.resetCachedCostInfo(Caller);
- }
- void growCachedCostInfo(Function* Caller, Function* Callee) {
- CA.growCachedCostInfo(Caller, Callee);
- }
virtual bool doFinalization(CallGraph &CG) {
return removeDeadFunctions(CG, /*AlwaysInlineOnly=*/true);
}
virtual bool doInitialization(CallGraph &CG);
- void releaseMemory() {
- CA.clear();
- }
};
}
diff --git a/llvm/lib/Transforms/IPO/InlineSimple.cpp b/llvm/lib/Transforms/IPO/InlineSimple.cpp
index 7acb445ba3b..50038d81161 100644
--- a/llvm/lib/Transforms/IPO/InlineSimple.cpp
+++ b/llvm/lib/Transforms/IPO/InlineSimple.cpp
@@ -42,16 +42,7 @@ namespace {
InlineCost getInlineCost(CallSite CS) {
return CA.getInlineCost(CS, getInlineThreshold(CS));
}
- void resetCachedCostInfo(Function *Caller) {
- CA.resetCachedCostInfo(Caller);
- }
- void growCachedCostInfo(Function* Caller, Function* Callee) {
- CA.growCachedCostInfo(Caller, Callee);
- }
virtual bool doInitialization(CallGraph &CG);
- void releaseMemory() {
- CA.clear();
- }
};
}
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp
index 5244ffba30f..2d703980c33 100644
--- a/llvm/lib/Transforms/IPO/Inliner.cpp
+++ b/llvm/lib/Transforms/IPO/Inliner.cpp
@@ -415,8 +415,6 @@ bool Inliner::runOnSCC(CallGraphSCC &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;
@@ -457,9 +455,6 @@ bool Inliner::runOnSCC(CallGraphSCC &SCC) {
CallSites.push_back(std::make_pair(CallSite(Ptr), NewHistoryID));
}
}
-
- // 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,
@@ -479,8 +474,6 @@ bool Inliner::runOnSCC(CallGraphSCC &SCC) {
// Remove any call graph edges from the callee to its callees.
CalleeNode->removeAllCalledFunctions();
- resetCachedCostInfo(Callee);
-
// Removing the node for callee from the call graph and delete it.
delete CG.removeFunctionFromModule(CalleeNode);
++NumDeleted;
@@ -566,7 +559,6 @@ bool Inliner::removeDeadFunctions(CallGraph &CG, bool AlwaysInlineOnly) {
for (SmallVectorImpl<CallGraphNode *>::iterator I = FunctionsToRemove.begin(),
E = FunctionsToRemove.end();
I != E; ++I) {
- resetCachedCostInfo((*I)->getFunction());
delete CG.removeFunctionFromModule(*I);
++NumDeleted;
}
OpenPOWER on IntegriCloud