summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-03-10 07:57:50 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-03-10 07:57:50 +0000
commit1c94228de3b0ffd6e1cd344b1a7cc3d41c91d609 (patch)
tree5d55f5a1fceb3e531cfb15bd087c9845af6bed31 /llvm/lib/Transforms/Utils
parent07393e05467037c92ee0c42ae7e20687ae96bb7a (diff)
downloadbcm5719-llvm-1c94228de3b0ffd6e1cd344b1a7cc3d41c91d609.tar.gz
bcm5719-llvm-1c94228de3b0ffd6e1cd344b1a7cc3d41c91d609.zip
If a function is marked alwaysinline, it must be inlined (possibly for correctness). Do so even if the callee has dynamic alloca and the caller doesn't.
llvm-svn: 66539
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/InlineCost.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineCost.cpp b/llvm/lib/Transforms/Utils/InlineCost.cpp
index 209ba927181..ce8b542bdf4 100644
--- a/llvm/lib/Transforms/Utils/InlineCost.cpp
+++ b/llvm/lib/Transforms/Utils/InlineCost.cpp
@@ -224,6 +224,13 @@ InlineCost InlineCostAnalyzer::getInlineCost(CallSite CS,
if (CalleeFI.NeverInline)
return InlineCost::getNever();
+ // FIXME: It would be nice to kill off CalleeFI.NeverInline. Then we
+ // could move this up and avoid computing the FunctionInfo for
+ // things we are going to just return always inline for. This
+ // requires handling setjmp somewhere else, however.
+ if (!Callee->isDeclaration() && Callee->hasFnAttr(Attribute::AlwaysInline))
+ return InlineCost::getAlways();
+
if (CalleeFI.usesDynamicAlloca) {
// Get infomation about the caller...
FunctionInfo &CallerFI = CachedFunctionInfo[Caller];
@@ -239,13 +246,6 @@ InlineCost InlineCostAnalyzer::getInlineCost(CallSite CS,
return InlineCost::getNever();
}
- // FIXME: It would be nice to kill off CalleeFI.NeverInline. Then we
- // could move this up and avoid computing the FunctionInfo for
- // things we are going to just return always inline for. This
- // requires handling setjmp somewhere else, however.
- if (!Callee->isDeclaration() && Callee->hasFnAttr(Attribute::AlwaysInline))
- return InlineCost::getAlways();
-
// Add to the inline quality for properties that make the call valuable to
// inline. This includes factors that indicate that the result of inlining
// the function will be optimizable. Currently this just looks at arguments
OpenPOWER on IntegriCloud