summaryrefslogtreecommitdiffstats
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-10 22:33:30 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-10 22:33:30 +0000
commit2625ff05d1d2b19e4779319e4370fd69ff15e9f0 (patch)
tree60f4c57bd6dd81006748f1e3212df2fae47e1faf /gcc/tree-cfg.c
parent1f367a28eadc967d51857be1c00a5040f0b2c6c5 (diff)
downloadppe42-gcc-2625ff05d1d2b19e4779319e4370fd69ff15e9f0.tar.gz
ppe42-gcc-2625ff05d1d2b19e4779319e4370fd69ff15e9f0.zip
* tree-cfg.c (tree_duplicate_sese_region): Update profile.
* tree-optimize.c (init_tree_optimization_passes) Swap pass_ch and pass_profile. * tree-ssa-loop-ch.c (copy_loop_headers): Do not update profile here. Remove rewrite_into_loop_closed_ssa call. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99547 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index ccafd9a7832..c54305c898b 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -4847,6 +4847,7 @@ tree_duplicate_sese_region (edge entry, edge exit,
edge exit_copy;
basic_block *doms;
edge redirected;
+ int total_freq, entry_freq;
if (!can_copy_bbs_p (region, n_region))
return false;
@@ -4893,12 +4894,24 @@ tree_duplicate_sese_region (edge entry, edge exit,
gcc_assert (!need_ssa_update_p ());
- /* Record blocks outside the region that are duplicated by something
+ /* Record blocks outside the region that are dominated by something
inside. */
doms = xmalloc (sizeof (basic_block) * n_basic_blocks);
n_doms = get_dominated_by_region (CDI_DOMINATORS, region, n_region, doms);
+ total_freq = entry->dest->frequency;
+ entry_freq = EDGE_FREQUENCY (entry);
+ /* Fix up corner cases, to avoid division by zero or creation of negative
+ frequencies. */
+ if (total_freq == 0)
+ total_freq = 1;
+ else if (entry_freq > total_freq)
+ entry_freq = total_freq;
+
copy_bbs (region, n_region, region_copy, &exit, 1, &exit_copy, loop);
+ scale_bbs_frequencies_int (region, n_region, total_freq - entry_freq,
+ total_freq);
+ scale_bbs_frequencies_int (region_copy, n_region, entry_freq, total_freq);
if (copying_header)
{
OpenPOWER on IntegriCloud