]> gcc.gnu.org Git - gcc.git/commitdiff
cfgcleanup.c (outgoing_edges_math): Fix condition; relax frequencies match; avoid...
authorJan Hubicka <jh@suse.cz>
Fri, 22 Mar 2002 11:11:21 +0000 (12:11 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 22 Mar 2002 11:11:21 +0000 (11:11 +0000)
* cfgcleanup.c (outgoing_edges_math): Fix condition; relax
frequencies match; avoid match on different loop depths.
(try_crossjump_to_bb): Kill tests that no longer brings time
savings.
* cfgrtl.c (force_nonfallthru_and_redirect): Fix loop_depth
updating code.
(split_edge): Likewise.

* flow.c (update_life_info_in_dirty_blocks): Fix uninitialized
variable.

* Makefile.in (cfgrtl): Add insn-config.h depenendency.
* cfgrtl.c: Include insn-config.h
(split_block) Dirtify block in presence of conditional execution

From-SVN: r51168

gcc/ChangeLog
gcc/Makefile.in
gcc/cfgcleanup.c
gcc/cfgrtl.c
gcc/flow.c

index eadd60735300ff930d58ff4f89fba64260d4df56..8a3de753a4d116a3a8a469c19ccb493438c07d60 100644 (file)
@@ -1,3 +1,20 @@
+Fri Mar 22 12:08:36 CET 2002  Jan Hubicka  <jh@suse.cz>
+
+       * cfgcleanup.c (outgoing_edges_math): Fix condition; relax
+       frequencies match; avoid match on different loop depths.
+       (try_crossjump_to_bb): Kill tests that no longer brings time
+       savings.
+       * cfgrtl.c (force_nonfallthru_and_redirect): Fix loop_depth
+       updating code.
+       (split_edge): Likewise.
+
+       * flow.c (update_life_info_in_dirty_blocks): Fix uninitialized
+       variable.
+
+       * Makefile.in (cfgrtl): Add insn-config.h depenendency.
+       * cfgrtl.c: Include insn-config.h
+       (split_block) Dirtify block in presence of conditional execution
+
 2002-03-22  Richard Sandiford  <rsandifo@redhat.com>
 
        * config/mips/abi64.h (SETUP_INCOMING_VARARGS): Undefine.
index 1b2e215f43e9e5e3686328f17a5114cb0ea33cd3..462e20e4c682af2ab919c8dff53032227c6e6280 100644 (file)
@@ -1494,7 +1494,7 @@ cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h insn-config.h \
    function.h except.h $(GGC_H) $(TM_P_H)
 cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h insn-config.h \
    $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
-   function.h except.h $(GGC_H) $(TM_P_H)
+   function.h except.h $(GGC_H) $(TM_P_H) insn-config.h
 cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(BASIC_BLOCK_H) \
    hard-reg-set.h insn-config.h $(RECOG_H) $(GGC_H) $(TM_P_H)
 cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h insn-config.h \
index 078b669f3c0b02ef35c065bcef5e60e544c80c05..bc637e4ee4829e1050f7a4c6ea9f715c4eca3cb0 100644 (file)
@@ -1116,9 +1116,20 @@ outgoing_edges_match (mode, bb1, bb2)
 
       if (!bb2->succ
           || !bb2->succ->succ_next
-         || bb1->succ->succ_next->succ_next
+         || bb2->succ->succ_next->succ_next
          || !any_condjump_p (bb2->end)
-         || !onlyjump_p (bb1->end))
+         || !onlyjump_p (bb2->end))
+       return false;
+
+      /* Do not crossjump across loop boundaries.  This is a temporary
+        workaround for the common scenario in which crossjumping results
+        in killing the duplicated loop condition, making bb-reorder rotate
+        the loop incorectly, leaving an extra unconditional jump inside
+        the loop.
+
+        This check should go away once bb-reorder knows how to duplicate
+        code in this case or rotate the loops to avoid this scenario.  */
+      if (bb1->loop_depth != bb2->loop_depth)
        return false;
 
       b1 = BRANCH_EDGE (bb1);
@@ -1194,9 +1205,10 @@ outgoing_edges_match (mode, bb1, bb2)
            /* Do not use f2 probability as f2 may be forwarded.  */
            prob2 = REG_BR_PROB_BASE - b2->probability;
 
-         /* Fail if the difference in probabilities is
-            greater than 5%.  */
-         if (abs (b1->probability - prob2) > REG_BR_PROB_BASE / 20)
+         /* Fail if the difference in probabilities is greater than 50%.
+            This rules out two well-predicted branches with opposite
+            outcomes.  */
+         if (abs (b1->probability - prob2) > REG_BR_PROB_BASE / 5)
            {
              if (rtl_dump_file)
                fprintf (rtl_dump_file,
index 5bf33bc0795912153d6150be4b2a314c7cac4d08..a4f7006d392f96299f0d932abeba6b09329d0a6f 100644 (file)
@@ -56,6 +56,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "toplev.h"
 #include "tm_p.h"
 #include "obstack.h"
+#include "insn-config.h"
 
 /* Stubs in case we don't have a return insn.  */
 #ifndef HAVE_return
@@ -546,6 +547,15 @@ split_block (bb, insn)
       propagate_block (new_bb, new_bb->global_live_at_start, NULL, NULL, 0);
       COPY_REG_SET (bb->global_live_at_end,
                    new_bb->global_live_at_start);
+#ifdef HAVE_conditional_execution
+      /* In the presence of conditional execution we are not able to update
+        liveness precisely.  */
+      if (reload_completed)
+       {
+         bb->flags |= BB_DIRTY;
+         new_bb->flags |= BB_DIRTY;
+       }
+#endif
     }
 
   return new_edge;
index 659815c5043fd854e66dd86491442faa610b41b8..71ed939da63ee13152d7838cebec713299fd3af8 100644 (file)
@@ -764,7 +764,7 @@ update_life_info_in_dirty_blocks (extent, prop_flags)
   sbitmap update_life_blocks = sbitmap_alloc (n_basic_blocks);
   int block_num;
   int n = 0;
-  int ndead;
+  int retval = 0;
 
   sbitmap_zero (update_life_blocks);
   for (block_num = 0; block_num < n_basic_blocks; block_num++)
@@ -775,10 +775,10 @@ update_life_info_in_dirty_blocks (extent, prop_flags)
       }
 
   if (n)
-    ndead = update_life_info (update_life_blocks, extent, prop_flags);
+    retval = update_life_info (update_life_blocks, extent, prop_flags);
 
   sbitmap_free (update_life_blocks);
-  return ndead;
+  return retval;
 }
 
 /* Free the variables allocated by find_basic_blocks.
This page took 0.088661 seconds and 5 git commands to generate.