From 1f171920601497b71b71104a92ada6d4c5e2a29f Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Wed, 12 Mar 2014 16:30:34 +0000 Subject: [PATCH] Don't recompute inlining threshold - use new overload provided by LLVM Follow-up on LLVM r203669 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203673 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/BackendUtil.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index 9215438533..eee32925a7 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -308,19 +308,12 @@ void EmitAssemblyHelper::CreatePasses() { PMBuilder.LibraryInfo = new TargetLibraryInfo(TargetTriple); if (!CodeGenOpts.SimplifyLibCalls) PMBuilder.LibraryInfo->disableAllFunctions(); - + switch (Inlining) { case CodeGenOptions::NoInlining: break; case CodeGenOptions::NormalInlining: { - // FIXME: Derive these constants in a principled fashion. - unsigned Threshold = 225; - if (CodeGenOpts.OptimizeSize == 1) // -Os - Threshold = 75; - else if (CodeGenOpts.OptimizeSize == 2) // -Oz - Threshold = 25; - else if (OptLevel > 2) - Threshold = 275; - PMBuilder.Inliner = createFunctionInliningPass(Threshold); + PMBuilder.Inliner = + createFunctionInliningPass(OptLevel, CodeGenOpts.OptimizeSize); break; } case CodeGenOptions::OnlyAlwaysInlining: -- 2.40.0