summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/InlineCost.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-03-09 23:02:17 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-03-09 23:02:17 +0000
commitf7477470d37ee2ab9075eaee4745fa084d424ab8 (patch)
treefa17e2f7865439d30ac1404648737d03034b33a2 /include/llvm/Analysis/InlineCost.h
parentf291be3159530fdca2fd5e726ec2bd3100f38e55 (diff)
downloadllvm-f7477470d37ee2ab9075eaee4745fa084d424ab8.tar.gz
llvm-f7477470d37ee2ab9075eaee4745fa084d424ab8.tar.bz2
llvm-f7477470d37ee2ab9075eaee4745fa084d424ab8.tar.xz
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. This is a more conservative version of r98089 that doesn't break the clang test CodeGenCXX/temp-order.cpp. That test relies on rather extreme inlining for constant folding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98099 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/InlineCost.h')
-rw-r--r--include/llvm/Analysis/InlineCost.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/Analysis/InlineCost.h b/include/llvm/Analysis/InlineCost.h
index 84acd7d5fe..f0e97d7a18 100644
--- a/include/llvm/Analysis/InlineCost.h
+++ b/include/llvm/Analysis/InlineCost.h
@@ -179,6 +179,11 @@ namespace llvm {
void resetCachedCostInfo(Function* Caller) {
CachedFunctionInfo[Caller] = FunctionInfo();
}
+
+ /// 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);
};
}