[llvm-branch-commits] [cfe-branch] r73489 - /cfe/branches/Apple/Dib/tools/clang-cc/Backend.cpp

Daniel Dunbar daniel at zuster.org
Tue Jun 16 09:13:20 PDT 2009


Author: ddunbar
Date: Tue Jun 16 11:13:19 2009
New Revision: 73489

URL: http://llvm.org/viewvc/llvm-project?rev=73489&view=rev
Log:
Merge in 73204 (<rdar://problem/6968122>):

------------------------------------------------------------------------
r73204 | efriedma | 2009-06-11 13:33:41 -0700 (Thu, 11 Jun 2009) | 4 lines

PR4371: Reduce the inlining threshold outside of -O3.  This makes 
the clang inlining threshold consistent with the threshold for llvm-gcc.


------------------------------------------------------------------------

Modified:
    cfe/branches/Apple/Dib/tools/clang-cc/Backend.cpp

Modified: cfe/branches/Apple/Dib/tools/clang-cc/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/tools/clang-cc/Backend.cpp?rev=73489&r1=73488&r2=73489&view=diff

==============================================================================
--- cfe/branches/Apple/Dib/tools/clang-cc/Backend.cpp (original)
+++ cfe/branches/Apple/Dib/tools/clang-cc/Backend.cpp Tue Jun 16 11:13:19 2009
@@ -319,9 +319,12 @@
       PM->add(createPruneEHPass());               // Remove dead EH info
       PM->add(createFunctionAttrsPass());         // Set readonly/readnone attrs
     }
-    if (CompileOpts.InlineFunctions)
-      PM->add(createFunctionInliningPass());      // Inline small functions
-    else 
+    if (CompileOpts.InlineFunctions) {
+      // Inline small functions
+      unsigned Threshold = (CompileOpts.OptimizeSize ||
+                            CompileOpts.OptimizationLevel < 3) ? 50 : 200;
+      PM->add(createFunctionInliningPass(Threshold));
+    } else 
       PM->add(createAlwaysInlinerPass());         // Respect always_inline
     if (CompileOpts.OptimizationLevel > 2)
       PM->add(createArgumentPromotionPass());     // Scalarize uninlined fn args





More information about the llvm-branch-commits mailing list