[llvm-commits] [llvm-gcc-4.2] r51430 - in /llvm-gcc-4.2/trunk/gcc: ipa-inline.c passes.c

Duncan Sands baldrick at free.fr
Thu May 22 07:31:19 PDT 2008


Author: baldrick
Date: Thu May 22 09:31:18 2008
New Revision: 51430

URL: http://llvm.org/viewvc/llvm-project?rev=51430&view=rev
Log:
Turn off all gcc optimizations again, except
for the gcc inliner.  Before the inliner was
left on too, but only enabled for always_inline
functions.  This time it is completely enabled.
My testing shows that the WebKit slowdown (PR2353)
was due to disabling the inliner, and not due to
turning off the other gcc optimization passes.
As for why the gcc inliner helps so much here -
well, that still remains to be analysed. 

Modified:
    llvm-gcc-4.2/trunk/gcc/ipa-inline.c
    llvm-gcc-4.2/trunk/gcc/passes.c

Modified: llvm-gcc-4.2/trunk/gcc/ipa-inline.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ipa-inline.c?rev=51430&r1=51429&r2=51430&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/ipa-inline.c (original)
+++ llvm-gcc-4.2/trunk/gcc/ipa-inline.c Thu May 22 09:31:18 2008
@@ -941,7 +941,11 @@
 	/* At the moment, no IPA passes change function bodies before inlining.
 	   Save some time by not recomputing function body sizes if early inlining
 	   already did so.  */
+        /* LLVM local begin - Don't rely on pass_early_ipa_inline being run.  */
+#ifndef ENABLE_LLVM
 	if (!flag_early_inlining)
+#endif
+        /* LLVM local end */
 	  node->local.self_insns = node->global.insns
 	     = estimate_num_insns (node->decl);
 
@@ -1028,9 +1032,19 @@
 		 overall_insns - old_insns);
     }
 
+  /* LLVM local begin */
+#ifdef ENABLE_LLVM
+  if (1) /* FIXME: 1 should be 0 some day, see PR2353.  */
+#endif
+  /* LLVM local end*/
   if (!flag_really_no_inline)
     cgraph_decide_inlining_of_small_functions ();
 
+  /* LLVM local begin */
+#ifdef ENABLE_LLVM
+  if (1) /* FIXME: 1 should be 0 some day, see PR2353.  */
+#endif
+  /* LLVM local end*/
   if (!flag_really_no_inline
       && flag_inline_functions_called_once)
     {
@@ -1148,6 +1162,11 @@
       }
 
   /* Now do the automatic inlining.  */
+  /* LLVM local begin */
+#ifdef ENABLE_LLVM
+  if (1) /* FIXME: 1 should be 0 some day, see PR2353.  */
+#endif
+  /* LLVM local end */
   if (!flag_really_no_inline)
     for (e = node->callees; e; e = e->next_callee)
       if (e->callee->local.inlinable

Modified: llvm-gcc-4.2/trunk/gcc/passes.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/passes.c?rev=51430&r1=51429&r2=51430&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/passes.c (original)
+++ llvm-gcc-4.2/trunk/gcc/passes.c Thu May 22 09:31:18 2008
@@ -481,18 +481,20 @@
 #define NEXT_PASS(PASS)  (p = next_pass_1 (p, &PASS))
   /* Interprocedural optimization passes.  */
   p = &all_ipa_passes;
+  /* LLVM local begin */
+#ifndef ENABLE_LLVM
   NEXT_PASS (pass_early_ipa_inline);
   NEXT_PASS (pass_early_local_passes);
   NEXT_PASS (pass_ipa_cp);
-  NEXT_PASS (pass_ipa_inline);
-/* LLVM LOCAL begin */
+#endif
+  NEXT_PASS (pass_ipa_inline); /* LLVM: inline functions marked always_inline */
 #ifndef ENABLE_LLVM
   NEXT_PASS (pass_ipa_reference);
   NEXT_PASS (pass_ipa_pure_const); 
   NEXT_PASS (pass_ipa_type_escape);
   NEXT_PASS (pass_ipa_pta);
 #endif
-/* LLVM LOCAL end */
+  /* LLVM local end */
   *p = NULL;
 
   /* All passes needed to lower the function into shape optimizers can
@@ -504,9 +506,9 @@
   NEXT_PASS (pass_lower_cf);
   NEXT_PASS (pass_lower_eh);
   NEXT_PASS (pass_build_cfg);
-  NEXT_PASS (pass_lower_complex_O0);
   /* LLVM LOCAL begin */
 #ifndef ENABLE_LLVM
+  NEXT_PASS (pass_lower_complex_O0);
   NEXT_PASS (pass_lower_vector);
 #endif
   /* LLVM LOCAL end */
@@ -518,16 +520,6 @@
   /* LLVM LOCAL end */
   *p = NULL;
 
-  p = &pass_early_local_passes.sub;
-  /* LLVM LOCAL begin */
-#ifndef ENABLE_LLVM
-  NEXT_PASS (pass_tree_profile);
-#endif
-  /* LLVM LOCAL end */
-  NEXT_PASS (pass_cleanup_cfg);
-  NEXT_PASS (pass_rebuild_cgraph_edges);
-  *p = NULL;
-
   /* LLVM LOCAL begin */
 #ifdef ENABLE_LLVM
   p = &all_extra_lowering_passes;
@@ -539,6 +531,14 @@
 #endif
   /* LLVM LOCAL end */
 
+  /* LLVM LOCAL begin - Do not pull in symbols. */
+#ifndef ENABLE_LLVM
+  p = &pass_early_local_passes.sub;
+  NEXT_PASS (pass_tree_profile);
+  NEXT_PASS (pass_cleanup_cfg);
+  NEXT_PASS (pass_rebuild_cgraph_edges);
+  *p = NULL;
+
   p = &all_passes;
   NEXT_PASS (pass_fixup_cfg);
   NEXT_PASS (pass_init_datastructures);
@@ -684,8 +684,6 @@
   NEXT_PASS (pass_dce_loop);
   *p = NULL;
 
-  /* LLVM LOCAL begin */
-#ifndef ENABLE_LLVM
   p = &pass_loop2.sub;
   NEXT_PASS (pass_rtl_loop_init);
   NEXT_PASS (pass_rtl_move_loop_invariants);
@@ -761,7 +759,7 @@
   NEXT_PASS (pass_final);
   *p = NULL;
 #endif
-  /* LLVM LOCAL end */
+  /* LLVM local end */
 
 #undef NEXT_PASS
 
@@ -775,11 +773,12 @@
   register_dump_files (all_extra_lowering_passes, false,
 		       PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh
 		       | PROP_cfg);
-#endif
-  /* LLVM LOCAL end */
+#else
   register_dump_files (all_passes, false,
 		       PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh
 		       | PROP_cfg);
+#endif
+  /* LLVM LOCAL end */
 }
 
 static unsigned int last_verified;





More information about the llvm-commits mailing list