OSDN Git Service

* function.c (dup_block_and_redirect): Update profile.
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 29 Sep 2012 12:31:49 +0000 (12:31 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 29 Sep 2012 12:31:49 +0000 (12:31 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191851 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/function.c

index 068a264..1845cfc 100644 (file)
@@ -1,3 +1,7 @@
+2012-09-28  Jan Hubicka  <jh@suse.cz>
+
+       * function.c (dup_block_and_redirect): Update profile.
+
 2012-09-29  Andreas Tobler  <andreast@fgznet.ch>
 
        * config.gcc: Replace 'host' with 'target' when configuring for
index d6e1954..9efbc3a 100644 (file)
@@ -5668,6 +5668,15 @@ dup_block_and_redirect (basic_block bb, basic_block copy_bb, rtx before,
   for (ei = ei_start (bb->preds); (e = ei_safe_edge (ei)); )
     if (!bitmap_bit_p (need_prologue, e->src->index))
       {
+       int freq = EDGE_FREQUENCY (e);
+       copy_bb->count += e->count;
+       copy_bb->frequency += EDGE_FREQUENCY (e);
+       e->dest->count -= e->count;
+       if (e->dest->count < 0)
+         e->dest->count = 0;
+       e->dest->frequency -= freq;
+       if (e->dest->frequency < 0)
+         e->dest->frequency = 0;
        redirect_edge_and_branch_force (e, copy_bb);
        continue;
       }