This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH V3] rs6000: Refine small loop unroll in loop_unroll_adjust hook
Hi Jiu Fu,
On Thu, Nov 07, 2019 at 10:40:41PM +0800, Jiufu Guo wrote:
> gcc/
> 2019-11-07 Jiufu Guo <guojiufu@linux.ibm.com>
>
> PR tree-optimization/88760
> * gcc/config/rs6000/rs6000.opt (-munroll-only-small-loops): New option.
> * gcc/common/config/rs6000/rs6000-common.c
> (rs6000_option_optimization_table) [OPT_LEVELS_2_PLUS_SPEED_ONLY]:
> Turn on -funroll-loops and -munroll-only-small-loops.
> [OPT_LEVELS_ALL]: Turn off -fweb and -frename-registers.
> * config/rs6000/rs6000.c (rs6000_option_override_internal): Remove
> set of PARAM_MAX_UNROLL_TIMES and PARAM_MAX_UNROLLED_INSNS.
> Turn off -munroll-only-small-loops for explicit -funroll-loops.
> (TARGET_LOOP_UNROLL_ADJUST): Add loop unroll adjust hook.
> (rs6000_loop_unroll_adjust): Define it. Use -munroll-only-small-loops.
>
> gcc.testsuite/
> 2019-11-07 Jiufu Guo <guojiufu@linux.ibm.com>
>
> PR tree-optimization/88760
> * gcc.dg/pr59643.c: Update back to r277550.
Okay for trunk. Thanks! Just some formatting stuff:
> + /* Enable -munroll-only-small-loops with -funroll-loops to unroll small
> + loops at -O2 and above by default. */
The "l" of "loops" should align with the "E" of "Enable", and only two
spaces after a dot:
/* Enable -munroll-only-small-loops with -funroll-loops to unroll small
loops at -O2 and above by default. */
> +/* Implement targetm.loop_unroll_adjust. */
Only one space at the start of the comment.
> +static unsigned
> +rs6000_loop_unroll_adjust (unsigned nunroll, struct loop * loop)
struct loop *loop
> + /* TODO: This is hardcoded to 10 right now. It can be refined, for
> + example we may want to unroll very small loops more times (4 perhaps).
> + We also should use a PARAM for this. */
There will be target-specific params soon, if I understood correctly :-)
Cheers,
Segher