]> granicus.if.org Git - clang/commitdiff
Don't recompute inlining threshold - use new overload provided by LLVM
authorEli Bendersky <eliben@google.com>
Wed, 12 Mar 2014 16:30:34 +0000 (16:30 +0000)
committerEli Bendersky <eliben@google.com>
Wed, 12 Mar 2014 16:30:34 +0000 (16:30 +0000)
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

index 921543853338b708fb5332fb713d616689b19d6b..eee32925a789ace20231a1a8f5046989f1ffaec5 100644 (file)
@@ -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: