diff mbox

: Update bb->count to avoid erroneous partitioning decisions

Message ID 509A5860.3060503@st.com
State New
Headers show

Commit Message

Christian Bruel Nov. 7, 2012, 12:47 p.m. UTC
> OK,
> is bb1 going to die?  If not, probably bb1->count = 0 should be there, if so,
> then the bb1->frequency = 0 is redundant.

Agree, we do 'delete_basic_block (bb1)' and the frequency is not used in
between, so the setting to 0 seems unnecessary.

testing it:


OK when validation completes ?

thanks

Christian

Comments

Jan Hubicka Nov. 7, 2012, 2:38 p.m. UTC | #1
> 
> > OK,
> > is bb1 going to die?  If not, probably bb1->count = 0 should be there, if so,
> > then the bb1->frequency = 0 is redundant.
> 
> Agree, we do 'delete_basic_block (bb1)' and the frequency is not used in
> between, so the setting to 0 seems unnecessary.
> 
> testing it:
> 
> Index: tree-ssa-tail-merge.c
> ===================================================================
> --- tree-ssa-tail-merge.c       (revision 193283)
> +++ tree-ssa-tail-merge.c       (working copy)
> @@ -1488,8 +1488,9 @@ replace_block_by (basic_block bb1, basic_block bb2
>    bb2->frequency += bb1->frequency;
>    if (bb2->frequency > BB_FREQ_MAX)
>      bb2->frequency = BB_FREQ_MAX;
> -  bb1->frequency = 0;
> 
> +  bb2->count += bb1->count;
> +
>    /* Do updates that use bb1, before deleting bb1.  */
>    release_last_vdef (bb1);
>    same_succ_flush_bb (bb1);
> 
> OK when validation completes ?

OK,
thanks.
Honza
> 
> thanks
> 
> Christian
diff mbox

Patch

Index: tree-ssa-tail-merge.c
===================================================================
--- tree-ssa-tail-merge.c       (revision 193283)
+++ tree-ssa-tail-merge.c       (working copy)
@@ -1488,8 +1488,9 @@  replace_block_by (basic_block bb1, basic_block bb2
   bb2->frequency += bb1->frequency;
   if (bb2->frequency > BB_FREQ_MAX)
     bb2->frequency = BB_FREQ_MAX;
-  bb1->frequency = 0;

+  bb2->count += bb1->count;
+
   /* Do updates that use bb1, before deleting bb1.  */
   release_last_vdef (bb1);
   same_succ_flush_bb (bb1);