OSDN Git Service

* toplev.c (rest_of_compilation): Do jump threading before SSA path;
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Mar 2002 19:34:36 +0000 (19:34 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Mar 2002 19:34:36 +0000 (19:34 +0000)
consistently call delete_trivially_dead_insns after CSE and GCSE;
fix DFI_life dumping; do jump threading after liveness; do crossjumping
after liveness2; update comment in last crossjumping.
* cfgcleanup.c (try_crossjump_to_edge): Dirtify block.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50373 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cfgcleanup.c
gcc/toplev.c

index ff9a8dc..2a5c8c6 100644 (file)
@@ -1,3 +1,11 @@
+Wed Mar  6 20:32:09 CET 2002  Jan Hubicka  <jh@suse.cz>
+
+       * toplev.c (rest_of_compilation): Do jump threading before SSA path;
+       consistently call delete_trivially_dead_insns after CSE and GCSE;
+       fix DFI_life dumping; do jump threading after liveness; do crossjumping
+       after liveness2; update comment in last crossjumping.
+       * cfgcleanup.c (try_crossjump_to_edge): Dirtify block.
+
 Wed Mar  6 12:27:10 2002  Jeffrey A Law  (law@redhat.com)
 
        * m68k.h (CONST_COSTS): Lower cost of 0.0 when used inside a
index bce4153..2733726 100644 (file)
@@ -1353,6 +1353,8 @@ try_crossjump_to_edge (mode, e1, e2)
 
   redirect_to->count += src1->count;
   redirect_to->frequency += src1->frequency;
+  /* We may have some registers visible trought the block.  */
+  redirect_to->flags |= BB_DIRTY;
 
   /* Recompute the frequencies and counts of outgoing edges.  */
   for (s = redirect_to->succ; s; s = s->succ_next)
index 5cd2e44..bd25b41 100644 (file)
@@ -2629,7 +2629,8 @@ rest_of_compilation (decl)
   find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
   if (rtl_dump_file)
     dump_flow_info (rtl_dump_file);
-  cleanup_cfg ((optimize ? CLEANUP_EXPENSIVE : 0) | CLEANUP_PRE_LOOP);
+  cleanup_cfg ((optimize ? CLEANUP_EXPENSIVE : 0) | CLEANUP_PRE_LOOP
+              | (flag_thread_jumps ? CLEANUP_THREADING : 0));
 
   /* CFG is no longer maintained up-to-date.  */
   free_bb_for_insn ();
@@ -2722,8 +2723,7 @@ rest_of_compilation (decl)
       find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
       if (rtl_dump_file)
        dump_flow_info (rtl_dump_file);
-      cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP
-                  | (flag_thread_jumps ? CLEANUP_THREADING : 0));
+      cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
 
       /* Try to identify useless null pointer tests and delete them.  */
       if (flag_delete_null_pointer_checks)
@@ -2769,25 +2769,19 @@ rest_of_compilation (decl)
        rebuild_jump_labels (insns);
       purge_all_dead_edges (0);
 
+      delete_trivially_dead_insns (insns, max_reg_num ());
+
       /* If we are not running more CSE passes, then we are no longer
         expecting CSE to be run.  But always rerun it in a cheap mode.  */
       cse_not_expected = !flag_rerun_cse_after_loop && !flag_gcse;
 
       if (tem || optimize > 1)
        cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
-
-      /* Run this after jump optmizations remove all the unreachable code
-        so that unreachable code will not keep values live.  */
-      delete_trivially_dead_insns (insns, max_reg_num ());
-
       /* Try to identify useless null pointer tests and delete them.  */
       if (flag_delete_null_pointer_checks || flag_thread_jumps)
        {
          timevar_push (TV_JUMP);
 
-         cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP
-                      | (flag_thread_jumps ? CLEANUP_THREADING : 0));
-
          if (flag_delete_null_pointer_checks)
            delete_null_pointer_checks (insns);
          /* CFG is no longer maintained up-to-date.  */
@@ -2827,6 +2821,7 @@ rest_of_compilation (decl)
       cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
       tem = gcse_main (insns, rtl_dump_file);
       rebuild_jump_labels (insns);
+      delete_trivially_dead_insns (insns, max_reg_num ());
 
       save_csb = flag_cse_skip_blocks;
       save_cfj = flag_cse_follow_jumps;
@@ -2840,6 +2835,7 @@ rest_of_compilation (decl)
          reg_scan (insns, max_reg_num (), 1);
          tem2 = cse_main (insns, max_reg_num (), 0, rtl_dump_file);
          purge_all_dead_edges (0);
+         delete_trivially_dead_insns (insns, max_reg_num ());
          timevar_pop (TV_CSE);
          cse_not_expected = !flag_rerun_cse_after_loop;
        }
@@ -2851,7 +2847,6 @@ rest_of_compilation (decl)
          tem = tem2 = 0;
          timevar_push (TV_JUMP);
          rebuild_jump_labels (insns);
-         delete_trivially_dead_insns (insns, max_reg_num ());
          cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
          timevar_pop (TV_JUMP);
 
@@ -2861,6 +2856,7 @@ rest_of_compilation (decl)
              reg_scan (insns, max_reg_num (), 1);
              tem2 = cse_main (insns, max_reg_num (), 0, rtl_dump_file);
              purge_all_dead_edges (0);
+             delete_trivially_dead_insns (insns, max_reg_num ());
              timevar_pop (TV_CSE);
            }
        }
@@ -2991,6 +2987,7 @@ rest_of_compilation (decl)
          reg_scan (insns, max_reg_num (), 0);
          tem = cse_main (insns, max_reg_num (), 1, rtl_dump_file);
          purge_all_dead_edges (0);
+         delete_trivially_dead_insns (insns, max_reg_num ());
 
          if (tem)
            {
@@ -3009,7 +3006,7 @@ rest_of_compilation (decl)
 
   cse_not_expected = 1;
 
-  close_dump_file (DFI_life, print_rtl_with_bb, insns);
+  open_dump_file (DFI_life, decl);
   regclass_init ();
 
   check_function_return_warnings ();
@@ -3277,8 +3274,8 @@ rest_of_compilation (decl)
 
   if (optimize)
     {
-      cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_CROSSJUMP);
       life_analysis (insns, rtl_dump_file, PROP_FINAL);
+      cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_CROSSJUMP | CLEANUP_UPDATE_LIFE);
 
       /* This is kind of a heuristic.  We need to run combine_stack_adjustments
          even for machines with possibly nonzero RETURN_POPS_ARGS
@@ -3380,8 +3377,9 @@ rest_of_compilation (decl)
       timevar_push (TV_REORDER_BLOCKS);
       open_dump_file (DFI_bbro, decl);
 
-      /* Last attempt to optimize CFG, as life analyzis possibly removed
-        some instructions.  */
+      /* Last attempt to optimize CFG, as scheduling, peepholing
+        and insn splitting possibly introduced more crossjumping
+        oppurtuntities.  */
       cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK
                   | CLEANUP_CROSSJUMP);
       if (flag_reorder_blocks)