diff options
author | Dale Johannesen <dalej@apple.com> | 2009-01-08 21:45:23 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2009-01-08 21:45:23 +0000 |
commit | 4362387c74d8fb07ec914b3173abf834d639ff39 (patch) | |
tree | 0c7c4308429d7eea8c254da50dfa688bf5c64fc3 /include | |
parent | 86062afbc49b549a653d38fb03702051f3917df7 (diff) | |
download | external_llvm-4362387c74d8fb07ec914b3173abf834d639ff39.zip external_llvm-4362387c74d8fb07ec914b3173abf834d639ff39.tar.gz external_llvm-4362387c74d8fb07ec914b3173abf834d639ff39.tar.bz2 |
Do not inline functions with (dynamic) alloca into
functions that don't already have a (dynamic) alloca.
Dynamic allocas cause inefficient codegen and we shouldn't
propagate this (behavior follows gcc). Two existing tests
assumed such inlining would be done; they are hacked by
adding an alloca in the caller, preserving the point of
the tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61946 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Transforms/Utils/InlineCost.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/llvm/Transforms/Utils/InlineCost.h b/include/llvm/Transforms/Utils/InlineCost.h index 1698a81..415fc1e 100644 --- a/include/llvm/Transforms/Utils/InlineCost.h +++ b/include/llvm/Transforms/Utils/InlineCost.h @@ -78,6 +78,9 @@ namespace llvm { /// caller. bool NeverInline; + /// usesDynamicAlloca - True if this function calls alloca (in the C sense). + bool usesDynamicAlloca; + /// NumInsts, NumBlocks - Keep track of how large each function is, which /// is used to estimate the code size cost of inlining it. unsigned NumInsts, NumBlocks; @@ -93,8 +96,8 @@ namespace llvm { /// entry here. std::vector<ArgInfo> ArgumentWeights; - FunctionInfo() : NeverInline(false), NumInsts(0), NumBlocks(0), - NumVectorInsts(0) {} + FunctionInfo() : NeverInline(false), usesDynamicAlloca(false), NumInsts(0), + NumBlocks(0), NumVectorInsts(0) {} /// analyzeFunction - Fill in the current structure with information /// gleaned from the specified function. |