diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-12-08 23:15:55 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-12-08 23:15:55 +0000 |
commit | 90de51f1fc58e2cca28fb1e6c01b1e43f000f006 (patch) | |
tree | a993a4ac0308c6672cc468411c67bf91b1716c8b | |
parent | 92ef5d75720c032808181133e4d7c5f82230237e (diff) |
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
-rw-r--r-- | lib/Frontend/Backend.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Frontend/Backend.cpp b/lib/Frontend/Backend.cpp index 5930b33028..03b60e01d0 100644 --- a/lib/Frontend/Backend.cpp +++ b/lib/Frontend/Backend.cpp @@ -331,8 +331,14 @@ void BackendConsumer::CreatePasses() { switch (Inlining) { case CodeGenOptions::NoInlining: break; case CodeGenOptions::NormalInlining: { - // Inline small functions - unsigned Threshold = (CodeGenOpts.OptimizeSize || OptLevel < 3) ? 50 : 200; + // Set the inline threshold following llvm-gcc. + // + // 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); break; } |