aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgcleanup.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2002-03-22 12:11:21 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2002-03-22 11:11:21 +0000
commit0a2ed1f101ae61e97e3e652dde6a537ecb4a267c (patch)
treec1fc98111346b8e70b39c4624897463b590685e6 /gcc/cfgcleanup.c
parent4d72536eeccbed73b276fb236a89228c34d5f50f (diff)
downloadgcc-0a2ed1f101ae61e97e3e652dde6a537ecb4a267c.zip
gcc-0a2ed1f101ae61e97e3e652dde6a537ecb4a267c.tar.gz
gcc-0a2ed1f101ae61e97e3e652dde6a537ecb4a267c.tar.bz2
cfgcleanup.c (outgoing_edges_math): Fix condition; relax frequencies match; avoid match on different loop depths.
* 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
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r--gcc/cfgcleanup.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 078b669..bc637e4 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -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,