[dataflow][PATCH] Compute dominance information in ce2 pass.

Kenneth Zadeck zadeck@naturalbridge.com
Wed May 16 13:00:00 GMT 2007


Seongbae Park (???, ???) wrote:
> On 5/14/07, Seongbae Park <seongbae.park@gmail.com> wrote:
>> Hi,
>>
>> The attached patch fixes the performance regression on SPEC CPU2000
>> wupwise.
>> The mainline computes the dominance information in all ifconvert passes
>> except ce1, but df doesn't compute it at all.
>>
>> Bootstrap and regtest are still running.
>>
>> 2007-05-14 Seongbae Park <seongbae.park@gmail.com>
>>
>> * ifcvt.c (if_convert): New parameter RECOMPUTE_DOMINANCE.
>> (rest_of_handle_if_conversion, rest_of_handle_if_after_combine,
>> rest_of_handle_if_after_reload): New parameter to if_convert.
>
> The previous patch caused a bootstrap failure,
> primarily because some of the if conversion routines were not executed
> at all before my patch.
> Enclosed is the new patch which passed the bootstrap and regression
> tests.
>
> I think we probably want to add
> df-based routines that do equivalent to
> propagate_one_insn() so that people can compute
> live sets at arbitrary points in the instruction stream
> (without directly using df infrastructure).
> I'll try to do that sometime.
>
commit this and i will add these functions.

kenny


> The updated changelog is:
> 2007-05-16 Seongbae Park <seongbae.park@gmail.com>
>
> * ifcvt.c (dead_or_predicable): Compute the live set at EARLIEST.
> (if_convert): New parameter RECOMPUTE_DOMINANCE.
> (rest_of_handle_if_conversion, rest_of_handle_if_after_combine,
> rest_of_handle_if_after_reload): New parameter to if_convert.
>
>
> OK for the branch ?
> ------------------------------------------------------------------------
>
> Index: gcc/ifcvt.c
> ===================================================================
> --- gcc/ifcvt.c	(revision 124718)
> +++ gcc/ifcvt.c	(working copy)
> @@ -3834,17 +3834,25 @@ dead_or_predicable (basic_block test_bb,
>        /* For TEST, we're interested in a range of insns, not a whole block.
>  	 Moreover, we're interested in the insns live from OTHER_BB.  */
>        
> +      /* The loop below takes the set of live registers 
> +         after JUMP, and calculates the live set before EARLIEST. */
>        bitmap_copy (test_live, DF_LIVE_IN (other_bb));
>        for (insn = jump; ; insn = prev)
>  	{
>  	  if (INSN_P (insn))
>  	    {
>  	      unsigned int uid = INSN_UID (insn);
> -	      struct df_ref **def_rec;
> -	      for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
> +	      struct df_ref **rec;
> +	      for (rec = DF_INSN_UID_DEFS (uid); *rec; rec++)
>  		{
> -		  struct df_ref *def = *def_rec;
> +		  struct df_ref *def = *rec;
>  		  bitmap_set_bit (test_set, DF_REF_REGNO (def));
> +		  bitmap_clear_bit (test_live, DF_REF_REGNO (def));
> +		}
> +	      for (rec = DF_INSN_UID_USES (uid); *rec; rec++)
> +		{
> +		  struct df_ref *def = *rec;
> +		  bitmap_set_bit (test_live, DF_REF_REGNO (def));
>  		}
>  	    }
>  	  prev = PREV_INSN (insn);
> @@ -3958,7 +3966,7 @@ dead_or_predicable (basic_block test_bb,
>  /* Main entry point for all if-conversion.  */
>  
>  static void
> -if_convert (void)
> +if_convert (bool recompute_dominance)
>  {
>    basic_block bb;
>    int pass;
> @@ -3980,7 +3988,7 @@ if_convert (void)
>    free_dominance_info (CDI_DOMINATORS);
>  
>    /* Compute postdominators if we think we'll use them.  */
> -  if (HAVE_conditional_execution)
> +  if (HAVE_conditional_execution || recompute_dominance)
>      calculate_dominance_info (CDI_POST_DOMINATORS);
>  
>    df_set_flags (DF_LR_RUN_DCE);
> @@ -4067,7 +4075,7 @@ rest_of_handle_if_conversion (void)
>        if (dump_file)
>          dump_flow_info (dump_file, dump_flags);
>        cleanup_cfg (CLEANUP_EXPENSIVE);
> -      if_convert ();
> +      if_convert (false);
>      }
>  
>    cleanup_cfg (0);
> @@ -4105,7 +4113,7 @@ static unsigned int
>  rest_of_handle_if_after_combine (void)
>  {
>    no_new_pseudos = 0;
> -  if_convert ();
> +  if_convert (true);
>    no_new_pseudos = 1;
>    return 0;
>  }
> @@ -4140,7 +4148,7 @@ static unsigned int
>  rest_of_handle_if_after_reload (void)
>  {
>    if (flag_if_conversion2)
> -    if_convert ();
> +    if_convert (true);
>    return 0;
>  }
>  
>   



More information about the Gcc-patches mailing list