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 | 4cbf70c6f2aeead786e4967a7f717e81b2f9abfc (patch) | |
tree | 0c7c4308429d7eea8c254da50dfa688bf5c64fc3 /include/llvm/Transforms | |
parent | e2abfc2d8f0c8274f90b751ccdec1d01f27763fc (diff) | |
download | external_llvm-4cbf70c6f2aeead786e4967a7f717e81b2f9abfc.zip external_llvm-4cbf70c6f2aeead786e4967a7f717e81b2f9abfc.tar.gz external_llvm-4cbf70c6f2aeead786e4967a7f717e81b2f9abfc.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/llvm/Transforms')
-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. |