aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-threadupdate.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2004-09-19 18:04:03 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2004-09-19 16:04:03 +0000
commit15db5571d1567a4d05812f85853b9b95766b8f2e (patch)
tree2864608d6a5ce3c527756be3a276cd609e29f91f /gcc/tree-ssa-threadupdate.c
parent9714133875a19fcb1258b79d8c035d7a8d240d61 (diff)
downloadgcc-15db5571d1567a4d05812f85853b9b95766b8f2e.zip
gcc-15db5571d1567a4d05812f85853b9b95766b8f2e.tar.gz
gcc-15db5571d1567a4d05812f85853b9b95766b8f2e.tar.bz2
basic-block.h (update_bb_profile_after_threading): Declare.
* basic-block.h (update_bb_profile_after_threading): Declare. * cfg.c (update_bb_profile_after_threading): Break out from ... * cfgcleanup.c (try_forward_edges): ... here; use it. * tree-ssa-dom.c (thread_across_edge): Use it. * tree-ssa-threadupdate.c (create_block_for_threading): Zero out profile of the new BB. From-SVN: r87730
Diffstat (limited to 'gcc/tree-ssa-threadupdate.c')
-rw-r--r--gcc/tree-ssa-threadupdate.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index ce6dcad..112509f 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -172,17 +172,25 @@ static void
create_block_for_threading (basic_block bb, struct redirection_data *rd)
{
tree phi;
+ edge e;
/* We can use the generic block duplication code and simply remove
the stuff we do not need. */
rd->dup_block = duplicate_block (bb, NULL);
+ /* Zero out the profile, since the block is unreachable for now. */
+ rd->dup_block->frequency = 0;
+ rd->dup_block->count = 0;
+
/* The call to duplicate_block will copy everything, including the
useless COND_EXPR or SWITCH_EXPR at the end of the block. We just remove
the useless COND_EXPR or SWITCH_EXPR here rather than having a
specialized block copier. */
remove_last_stmt_and_useless_edges (rd->dup_block, rd->outgoing_edge->dest);
+ for (e = rd->dup_block->succ; e; e = e->succ_next)
+ e->count = 0;
+
/* If there are any PHI nodes at the destination of the outgoing edge
from the duplicate block, then we will need to add a new argument
to them. The argument should have the same value as the argument