llvm.org GIT mirror llvm / 45de584
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153813 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 8 years ago
6 changed file(s) with 0 addition(s) and 57 deletion(s). Raw diff Collapse all Expand all
121121 /// bound the computation necessary to determine whether the cost is
122122 /// sufficiently low to warrant inlining.
123123 InlineCost getInlineCost(CallSite CS, int Threshold);
124
125 /// resetCachedFunctionInfo - erase any cached cost info for this function.
126 void resetCachedCostInfo(Function* Caller) {
127 }
128
129 /// growCachedCostInfo - update the cached cost info for Caller after Callee
130 /// has been inlined. If Callee is NULL it means a dead call has been
131 /// eliminated.
132 void growCachedCostInfo(Function* Caller, Function* Callee);
133
134 /// clear - empty the cache of inline costs
135 void clear();
136124 };
137125
138126 /// callIsSmall - If a call is likely to lower to a single target instruction,
6464 ///
6565 virtual InlineCost getInlineCost(CallSite CS) = 0;
6666
67 /// resetCachedCostInfo - erase any cached cost data from the derived class.
68 /// If the derived class has no such data this can be empty.
69 ///
70 virtual void resetCachedCostInfo(Function* Caller) = 0;
71
72 /// growCachedCostInfo - update the cached cost info for Caller after Callee
73 /// has been inlined.
74 virtual void growCachedCostInfo(Function *Caller, Function *Callee) = 0;
75
7667 /// removeDeadFunctions - Remove dead functions.
7768 ///
7869 /// This also includes a hack in the form of the 'AlwaysInlineOnly' flag
10111011
10121012 return llvm::InlineCost::get(CA.getCost(), CA.getThreshold());
10131013 }
1014
1015 /// growCachedCostInfo - update the cached cost info for Caller after Callee has
1016 /// been inlined.
1017 void
1018 InlineCostAnalyzer::growCachedCostInfo(Function *Caller, Function *Callee) {
1019 }
1020
1021 /// clear - empty the cache of inline costs
1022 void InlineCostAnalyzer::clear() {
1023 }
6060 // indirectbr.
6161 return CA.getInlineCost(CS, getInlineThreshold(CS));
6262 }
63 void resetCachedCostInfo(Function *Caller) {
64 CA.resetCachedCostInfo(Caller);
65 }
66 void growCachedCostInfo(Function* Caller, Function* Callee) {
67 CA.growCachedCostInfo(Caller, Callee);
68 }
6963 virtual bool doFinalization(CallGraph &CG) {
7064 return removeDeadFunctions(CG, /*AlwaysInlineOnly=*/true);
7165 }
7266 virtual bool doInitialization(CallGraph &CG);
73 void releaseMemory() {
74 CA.clear();
75 }
7667 };
7768 }
7869
4141 InlineCost getInlineCost(CallSite CS) {
4242 return CA.getInlineCost(CS, getInlineThreshold(CS));
4343 }
44 void resetCachedCostInfo(Function *Caller) {
45 CA.resetCachedCostInfo(Caller);
46 }
47 void growCachedCostInfo(Function* Caller, Function* Callee) {
48 CA.growCachedCostInfo(Caller, Callee);
49 }
5044 virtual bool doInitialization(CallGraph &CG);
51 void releaseMemory() {
52 CA.clear();
53 }
5445 };
5546 }
5647
414414 CG[Caller]->removeCallEdgeFor(CS);
415415 CS.getInstruction()->eraseFromParent();
416416 ++NumCallsDeleted;
417 // Update the cached cost info with the missing call
418 growCachedCostInfo(Caller, NULL);
419417 } else {
420418 // We can only inline direct calls to non-declarations.
421419 if (Callee == 0 || Callee->isDeclaration()) continue;
456454 CallSites.push_back(std::make_pair(CallSite(Ptr), NewHistoryID));
457455 }
458456 }
459
460 // Update the cached cost info with the inlined call.
461 growCachedCostInfo(Caller, Callee);
462457 }
463458
464459 // If we inlined or deleted the last possible call site to the function,
478473 // Remove any call graph edges from the callee to its callees.
479474 CalleeNode->removeAllCalledFunctions();
480475
481 resetCachedCostInfo(Callee);
482
483476 // Removing the node for callee from the call graph and delete it.
484477 delete CG.removeFunctionFromModule(CalleeNode);
485478 ++NumDeleted;
565558 for (SmallVectorImpl::iterator I = FunctionsToRemove.begin(),
566559 E = FunctionsToRemove.end();
567560 I != E; ++I) {
568 resetCachedCostInfo((*I)->getFunction());
569561 delete CG.removeFunctionFromModule(*I);
570562 ++NumDeleted;
571563 }