[PATCH][V4] rs6000: Remove unnecessary option manipulation.

Segher Boessenkool segher@kernel.crashing.org
Fri Nov 19 12:45:10 GMT 2021


On Fri, Nov 19, 2021 at 01:31:21PM +0100, Martin Liška wrote:
> All right, so I can't send an email from my local machine and git imap-send
> does not work as it goes through Thunderbird.

Hrm, painful (for you).  You should figure out how you can do the basics
of the patch-based workflow that we all have to do.

> So my last attempt is attaching the email so that you can add the .eml file.

I cannot do that, but it is text, so it is inlined fine.  Thanks.

This is almost identical to what git format-patch would give you, btw.

> Subject: [PATCH][V4] rs6000: Remove unnecessary option manipulation.

> Do not set flag_rename_registers, it's already enabled with EnabledBy(funroll-loops)
> in the common.opt file. Use EnabledBy for unroll_only_small_loops which
> is a canonical approach how can be make option dependencies.
> 
> gcc/ChangeLog:
> 
> 	* config/rs6000/rs6000.c (rs6000_override_options_after_change):
> 	Do not set flag_rename_registers and unroll_only_small_loops.

Please don't end changelog lines in ":", it looks like something is
missing.  Changelog lines wrap at 80 cols.

> 	* config/rs6000/rs6000.opt: Use EnabledBy for unroll_only_small_loops.

> --- a/gcc/config/rs6000/rs6000.c
> +++ b/gcc/config/rs6000/rs6000.c
> @@ -3466,13 +3466,8 @@ rs6000_override_options_after_change (void)
>    /* Explicit -funroll-loops turns -munroll-only-small-loops off, and
>       turns -frename-registers on.  */
>    if ((OPTION_SET_P (flag_unroll_loops) && flag_unroll_loops)
> -       || (OPTION_SET_P (flag_unroll_all_loops)
> -	   && flag_unroll_all_loops))
> +       || (OPTION_SET_P (flag_unroll_all_loops) && flag_unroll_all_loops))

You should mention this change in the changelog as well.

> -      if (!OPTION_SET_P (unroll_only_small_loops))
> -	unroll_only_small_loops = 0;
> -      if (!OPTION_SET_P (flag_rename_registers))
> -	flag_rename_registers = 1;
>        if (!OPTION_SET_P (flag_cunroll_grow_size))
>  	flag_cunroll_grow_size = 1;
>      }
> diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
> index 9d7878f144a..faeb7423ca7 100644
> --- a/gcc/config/rs6000/rs6000.opt
> +++ b/gcc/config/rs6000/rs6000.opt
> @@ -546,7 +546,7 @@ Target Undocumented Var(rs6000_optimize_swaps) Init(1) Save
>  Analyze and remove doubleword swaps from VSX computations.
>  
>  munroll-only-small-loops
> -Target Undocumented Var(unroll_only_small_loops) Init(0) Save
> +Target Undocumented Var(unroll_only_small_loops) Init(0) Save EnabledBy(funroll-loops)
>  ; Use conservative small loop unrolling.

That is the opposite of the original logic.


Segher


More information about the Gcc-patches mailing list