summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2012-12-13 01:05:25 +0000
committerQuentin Colombet <qcolombet@apple.com>2012-12-13 01:05:25 +0000
commitc0dba2035a66b6de25983a216ab7c791799a940d (patch)
tree6639c3ca8e7c14d63c67cab5298be7c61f58c107 /llvm/lib/Transforms/IPO
parent436eea98338b9f4fe45a1c913cf44c30a4878975 (diff)
downloadbcm5719-llvm-c0dba2035a66b6de25983a216ab7c791799a940d.tar.gz
bcm5719-llvm-c0dba2035a66b6de25983a216ab7c791799a940d.zip
Take into account minimize size attribute in the inliner.
Better controls the inlining of functions when the caller function has MinSize attribute. Basically, when the caller function has this attribute, we do not "force" the inlining of callee functions carrying the InlineHint attribute (i.e., functions defined with inline keyword) llvm-svn: 170065
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r--llvm/lib/Transforms/IPO/Inliner.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp
index bd8fa66d52a..b636414250e 100644
--- a/llvm/lib/Transforms/IPO/Inliner.cpp
+++ b/llvm/lib/Transforms/IPO/Inliner.cpp
@@ -214,11 +214,13 @@ unsigned Inliner::getInlineThreshold(CallSite CS) const {
OptSizeThreshold < thres)
thres = OptSizeThreshold;
- // Listen to the inlinehint attribute when it would increase the threshold.
+ // Listen to the inlinehint attribute when it would increase the threshold
+ // and the caller does not need to minimize its size.
Function *Callee = CS.getCalledFunction();
bool InlineHint = Callee && !Callee->isDeclaration() &&
Callee->getFnAttributes().hasAttribute(Attributes::InlineHint);
- if (InlineHint && HintThreshold > thres)
+ if (InlineHint && HintThreshold > thres
+ && !Caller->getFnAttributes().hasAttribute(Attributes::MinSize))
thres = HintThreshold;
return thres;
OpenPOWER on IntegriCloud