[cfe-commits] r90897 - /cfe/trunk/lib/Frontend/Backend.cpp

Daniel Dunbar daniel at zuster.org
Tue Dec 8 15:15:55 PST 2009


Author: ddunbar
Date: Tue Dec  8 17:15:55 2009
New Revision: 90897

URL: http://llvm.org/viewvc/llvm-project?rev=90897&view=rev
Log:
Increase inlining threshold at -O3, to match llvm-gcc.

Modified:
    cfe/trunk/lib/Frontend/Backend.cpp

Modified: cfe/trunk/lib/Frontend/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/Backend.cpp?rev=90897&r1=90896&r2=90897&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/Backend.cpp (original)
+++ cfe/trunk/lib/Frontend/Backend.cpp Tue Dec  8 17:15:55 2009
@@ -331,8 +331,14 @@
   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;
   }





More information about the cfe-commits mailing list