[llvm-commits] [llvm-gcc-4.2] r51220 - in /llvm-gcc-4.2/trunk/gcc: cgraphunit.c passes.c

Duncan Sands baldrick at free.fr
Sat May 17 05:35:08 PDT 2008


Author: baldrick
Date: Sat May 17 07:35:08 2008
New Revision: 51220

URL: http://llvm.org/viewvc/llvm-project?rev=51220&view=rev
Log:
Only run gcc lowering passes.  Before we were
also running some ipa passes, for example
constant propagation and early inlining.  The
reason is that the gcc inliner knows how to
handle exception handling constructs optimally
(the stuff that becomes eh.selector etc intrinsics
in LLVM; and inlining of rethrow calls) while
LLVM handles them correctly but not optimally.
Hopefully someone will now be inspired to improve
LLVM's eh infrastructure wrt inlining!  I also
turned off the -O0 complex lowering which exists
for the benefit of the rtl expanders but shouldn't
be needed for llvm-gcc.

Modified:
    llvm-gcc-4.2/trunk/gcc/cgraphunit.c
    llvm-gcc-4.2/trunk/gcc/passes.c

Modified: llvm-gcc-4.2/trunk/gcc/cgraphunit.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cgraphunit.c?rev=51220&r1=51219&r2=51220&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cgraphunit.c (original)
+++ llvm-gcc-4.2/trunk/gcc/cgraphunit.c Sat May 17 07:35:08 2008
@@ -1614,9 +1614,13 @@
       dump_cgraph (cgraph_dump_file);
     }
     
+  /* LLVM local begin */
+#ifndef ENABLE_LLVM
   /* Don't run the IPA passes if there was any error or sorry messages.  */
   if (errorcount == 0 && sorrycount == 0)
     ipa_passes ();
+#endif
+  /* LLVM local end */
 
   /* This pass remove bodies of extern inline functions we never inlined.
      Do this later so other IPA passes see what is really going on.  */

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=51220&r1=51219&r2=51220&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/passes.c (original)
+++ llvm-gcc-4.2/trunk/gcc/passes.c Sat May 17 07:35:08 2008
@@ -485,14 +485,10 @@
   NEXT_PASS (pass_early_local_passes);
   NEXT_PASS (pass_ipa_cp);
   NEXT_PASS (pass_ipa_inline);
-/* LLVM LOCAL begin */
-#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 */
   *p = NULL;
 
   /* All passes needed to lower the function into shape optimizers can
@@ -504,9 +500,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 +514,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 +525,12 @@
 #endif
   /* LLVM LOCAL end */
 
+  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 +676,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);
@@ -760,8 +750,6 @@
   NEXT_PASS (pass_set_nothrow_function_flags);
   NEXT_PASS (pass_final);
   *p = NULL;
-#endif
-  /* LLVM LOCAL end */
 
 #undef NEXT_PASS
 





More information about the llvm-commits mailing list