зеркало из https://github.com/microsoft/clang-1.git
Increase inlining threshold at -O3, to match llvm-gcc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90897 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
92ef5d7572
Коммит
90de51f1fc
|
@ -331,8 +331,14 @@ void BackendConsumer::CreatePasses() {
|
||||||
switch (Inlining) {
|
switch (Inlining) {
|
||||||
case CodeGenOptions::NoInlining: break;
|
case CodeGenOptions::NoInlining: break;
|
||||||
case CodeGenOptions::NormalInlining: {
|
case CodeGenOptions::NormalInlining: {
|
||||||
// Inline small functions
|
// Set the inline threshold following llvm-gcc.
|
||||||
unsigned Threshold = (CodeGenOpts.OptimizeSize || OptLevel < 3) ? 50 : 200;
|
//
|
||||||
|
// FIXME: Derive these constants in a principled fashion.
|
||||||
|
unsigned Threshold = 200;
|
||||||
|
if (CodeGenOpts.OptimizeSize)
|
||||||
|
Threshold = 50;
|
||||||
|
else if (OptLevel > 2)
|
||||||
|
Threshold = 250;
|
||||||
InliningPass = createFunctionInliningPass(Threshold);
|
InliningPass = createFunctionInliningPass(Threshold);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче