diff options
author | Manman Ren <manman.ren@gmail.com> | 2014-04-25 17:34:55 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2014-04-25 17:34:55 +0000 |
commit | 3c44067a3058f594d869d374a7336543c8bbe80f (patch) | |
tree | 4d5f2faebed60b92fcb405f8eccf6bc259cd0fc7 /llvm/lib/Transforms/IPO/Inliner.cpp | |
parent | e071fc808264a6b86889862f930ff2d4d4b8bcc9 (diff) | |
download | bcm5719-llvm-3c44067a3058f594d869d374a7336543c8bbe80f.tar.gz bcm5719-llvm-3c44067a3058f594d869d374a7336543c8bbe80f.zip |
[inline cold threshold] Command line argument for inline threshold will
override the default cold threshold.
When we use command line argument to set the inline threshold, the default
cold threshold will not be used. This is in line with how we use
OptSizeThreshold. When we want a higher threshold for all functions, we
do not have to set both inline threshold and cold threshold.
llvm-svn: 207245
Diffstat (limited to 'llvm/lib/Transforms/IPO/Inliner.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/Inliner.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp index e6748c46988..10b20cfc917 100644 --- a/llvm/lib/Transforms/IPO/Inliner.cpp +++ b/llvm/lib/Transforms/IPO/Inliner.cpp @@ -290,7 +290,12 @@ unsigned Inliner::getInlineThreshold(CallSite CS) const { bool ColdCallee = Callee && !Callee->isDeclaration() && Callee->getAttributes().hasAttribute(AttributeSet::FunctionIndex, Attribute::Cold); - if (ColdCallee && ColdThreshold < thres) + // Command line argument for InlineLimit will override the default + // ColdThreshold. If we have -inline-threshold but no -inlinecold-threshold, + // do not use the default cold threshold even if it is smaller. + if ((InlineLimit.getNumOccurrences() == 0 || + ColdThreshold.getNumOccurrences() > 0) && ColdCallee && + ColdThreshold < thres) thres = ColdThreshold; return thres; |