Patchwork : Update bb->count to avoid erroneous partitioning decisions

login
register
mail settings
Submitter Christian Bruel
Date Nov. 7, 2012, 12:47 p.m.
Message ID <509A5860.3060503@st.com>
Download mbox | patch
Permalink /patch/197657/
State New
Headers show

Comments

Christian Bruel - Nov. 7, 2012, 12:47 p.m.
> 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
Jan Hubicka - Nov. 7, 2012, 2:38 p.m.
> 
> > 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

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);