llvm.org GIT mirror llvm / b381578
Reintroduce InlineCostAnalyzer::getInlineCost() variant with explicit callee parameter until we have a more sensible API for doing the same thing. Reviewed by Chandler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154180 91177308-0d34-0410-b5e6-96231b3b80d8 David Chisnall 8 years ago
2 changed file(s) with 14 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
116116 /// bound the computation necessary to determine whether the cost is
117117 /// sufficiently low to warrant inlining.
118118 InlineCost getInlineCost(CallSite CS, int Threshold);
119 /// getCalledFunction - The heuristic used to determine if we should inline
120 /// the function call or not. The callee is explicitly specified, to allow
121 /// you to calculate the cost of inlining a function via a pointer. This
122 /// behaves exactly as the version with no explicit callee parameter in all
123 /// other respects.
124 //
125 // Note: This is used by out-of-tree passes, please do not remove without
126 // adding a replacement API.
127 InlineCost getInlineCost(CallSite CS, Function *Callee, int Threshold);
119128 };
120129
121130 /// callIsSmall - If a call is likely to lower to a single target instruction,
987987 }
988988
989989 InlineCost InlineCostAnalyzer::getInlineCost(CallSite CS, int Threshold) {
990 Function *Callee = CS.getCalledFunction();
991
990 return getInlineCost(CS, CS.getCalledFunction(), Threshold);
991 }
992
993 InlineCost InlineCostAnalyzer::getInlineCost(CallSite CS, Function *Callee,
994 int Threshold) {
992995 // Don't inline functions which can be redefined at link-time to mean
993996 // something else. Don't inline functions marked noinline or call sites
994997 // marked noinline.