diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-03-09 22:17:11 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-03-09 22:17:11 +0000 |
commit | 741dec43e4e73a526c16939a68c65a851813f431 (patch) | |
tree | 83abd140ef1dde685e66ce5c6d396f0818ca6d70 /llvm/lib/Transforms/IPO/InlineSimple.cpp | |
parent | 5fba36cc1bcc02beaf20b28ecb42e0e3e5cae050 (diff) | |
download | llvm-741dec43e4e73a526c16939a68c65a851813f431.zip llvm-741dec43e4e73a526c16939a68c65a851813f431.tar.gz llvm-741dec43e4e73a526c16939a68c65a851813f431.tar.bz2 |
Try to keep the cached inliner costs around for a bit longer for big functions.
The Caller cost info would be reset everytime a callee was inlined. If the
caller has lots of calls and there is some mutual recursion going on, the
caller cost info could be calculated many times.
This patch reduces inliner runtime from 240s to 0.5s for a function with 20000
small function calls.
llvm-svn: 98089
Diffstat (limited to 'llvm/lib/Transforms/IPO/InlineSimple.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/InlineSimple.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/InlineSimple.cpp b/llvm/lib/Transforms/IPO/InlineSimple.cpp index 598043d..46cf4b2 100644 --- a/llvm/lib/Transforms/IPO/InlineSimple.cpp +++ b/llvm/lib/Transforms/IPO/InlineSimple.cpp @@ -45,6 +45,9 @@ namespace { void resetCachedCostInfo(Function *Caller) { CA.resetCachedCostInfo(Caller); } + void growCachedCostInfo(Function* Caller, Function* Callee) { + CA.growCachedCostInfo(Caller, Callee); + } virtual bool doInitialization(CallGraph &CG); }; } |