From 1ffa28a3f1cb1cc61c8937027015a549c60d18dc Mon Sep 17 00:00:00 2001 From: Xinliang David Li Date: Fri, 29 Apr 2016 21:21:44 +0000 Subject: [inliner]: Refactor inline deferring logic into its own method /NFC The implemented heuristic has a large body of code which better sits in its own function for better readability. It also allows adding more heuristics easier in the future. llvm-svn: 268107 --- llvm/include/llvm/Transforms/IPO/InlinerPass.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/include') diff --git a/llvm/include/llvm/Transforms/IPO/InlinerPass.h b/llvm/include/llvm/Transforms/IPO/InlinerPass.h index 40766c6f8b8..111bc860aba 100644 --- a/llvm/include/llvm/Transforms/IPO/InlinerPass.h +++ b/llvm/include/llvm/Transforms/IPO/InlinerPass.h @@ -69,6 +69,10 @@ private: /// shouldInline - Return true if the inliner should attempt to /// inline at the given CallSite. bool shouldInline(CallSite CS); + /// Return true if inlining of CS can block the caller from being + /// inlined which is proved to be more beneficial. \p IC is the + /// estimated inline cost associated with callsite \p CS. + bool shouldBeDeferred(Function *Caller, CallSite CS, InlineCost IC); protected: AssumptionCacheTracker *ACT; -- cgit v1.2.3