[Bug tree-optimization/88760] GCC unrolling is suboptimal

guojiufu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Nov 11 06:31:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88760

--- Comment #43 from Jiu Fu Guo <guojiufu at gcc dot gnu.org> ---
Author: guojiufu
Date: Mon Nov 11 06:30:38 2019
New Revision: 278034

URL: https://gcc.gnu.org/viewcvs?rev=278034&root=gcc&view=rev
Log:

rs6000: Refine small loop unroll in loop_unroll_adjust hook

In this patch, loop unroll adjust hook is introduced for powerpc.  We
can do target related heuristic adjustment in this hook.  In this patch,
-funroll-loops is enabled for small loops at O2 and above with an option
-munroll-small-loops to guard the small loops unrolling, and it works
fine with -flto.


gcc/
2019-11-11  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-11  Jiufu Guo  <guojiufu@linux.ibm.com>

        PR tree-optimization/88760
        * gcc.dg/pr59643.c: Update back to r277550.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/common/config/rs6000/rs6000-common.c
    trunk/gcc/config/rs6000/rs6000.c
    trunk/gcc/config/rs6000/rs6000.opt
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/pr59643.c


More information about the Gcc-bugs mailing list