diff options
author | nadav <nadav@91177308-0d34-0410-b5e6-96231b3b80d8> | 2012-09-19 08:08:04 +0000 |
---|---|---|
committer | nadav <nadav@91177308-0d34-0410-b5e6-96231b3b80d8> | 2012-09-19 08:08:04 +0000 |
commit | 6551b4d071f476b2906166d61435cb6dcc3acc5c (patch) | |
tree | 3234226bbf5d5452d9ae30dad950408a61de4757 /include | |
parent | e833a073d22e2526134ded221ce779f1aaac11c9 (diff) |
Prevent inlining of callees which allocate lots of memory into a recursive caller.
Example:
void foo() {
... foo(); // I'm recursive!
bar();
}
bar() { int a[1000]; // large stack size }
rdar://10853263
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164207 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/InlineCost.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/llvm/Analysis/InlineCost.h b/include/llvm/Analysis/InlineCost.h index 0cba135222..f8de533506 100644 --- a/include/llvm/Analysis/InlineCost.h +++ b/include/llvm/Analysis/InlineCost.h @@ -36,6 +36,9 @@ namespace llvm { const int LastCallToStaticBonus = -15000; const int ColdccPenalty = 2000; const int NoreturnPenalty = 10000; + /// Do not inline functions which allocate this many bytes on the stack + /// when the caller is recursive. + const int TotalAllocaSizeRecursiveCaller = 1024; } /// \brief Represents the cost of inlining a function. |