[llvm-branch-commits] [llvm-gcc-branch] r85984 - /llvm-gcc-4.2/branches/Apple/Leela/gcc/llvm-backend.cpp

Bill Wendling isanbard at gmail.com
Tue Nov 3 16:12:39 PST 2009


Author: void
Date: Tue Nov  3 18:12:38 2009
New Revision: 85984

URL: http://llvm.org/viewvc/llvm-project?rev=85984&view=rev
Log:
$ svn merge -c 85982 https://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk
--- Merging r85982 into '.':
U    gcc/llvm-backend.cpp


Modified:
    llvm-gcc-4.2/branches/Apple/Leela/gcc/llvm-backend.cpp

Modified: llvm-gcc-4.2/branches/Apple/Leela/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Leela/gcc/llvm-backend.cpp?rev=85984&r1=85983&r2=85984&view=diff

==============================================================================
--- llvm-gcc-4.2/branches/Apple/Leela/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Leela/gcc/llvm-backend.cpp Tue Nov  3 18:12:38 2009
@@ -352,11 +352,20 @@
 // inliner.  gcc has many options that control inlining, but we have decided
 // not to support anything like that for llvm-gcc.
 static unsigned GuessAtInliningThreshold() {
-  unsigned threshold = 200;
-  if (optimize_size || optimize < 3)
+  if (optimize_size)
     // Reduce inline limit.
-    threshold = 50;
-  return threshold;
+    return 50;
+  
+  if (optimize >= 3)
+    return 200;
+
+  // gcc mark C++ member functions "inline" and inline them more aggressively.
+  // We are not going to do that. Up the inline threshold when compiling for
+  // C++.
+  StringRef LanguageName = lang_hooks.name;
+  if (LanguageName == "GNU C++" || LanguageName == "GNU Objective-C++")
+    return 200;
+  return 50;
 }
 
 void llvm_initialize_backend(void) {





More information about the llvm-branch-commits mailing list