mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 02:25:19 +00:00
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207245 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user