aboutsummaryrefslogtreecommitdiff
path: root/gcc/common
diff options
context:
space:
mode:
authorJiufu Guo <guojiufu@linux.ibm.com>2019-11-11 06:30:38 +0000
committerJiufu Guo <guojiufu@gcc.gnu.org>2019-11-11 06:30:38 +0000
commit48f657953fe5f90218003c93feafdb3158e6d3d2 (patch)
tree9723a1ee3ec29985e19ff7b9bd0b48b9bfb5892e /gcc/common
parent103cba80bd84f0f3c7e644783e1fb7154d07f522 (diff)
downloadgcc-48f657953fe5f90218003c93feafdb3158e6d3d2.zip
gcc-48f657953fe5f90218003c93feafdb3158e6d3d2.tar.gz
gcc-48f657953fe5f90218003c93feafdb3158e6d3d2.tar.bz2
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. From-SVN: r278034
Diffstat (limited to 'gcc/common')
-rw-r--r--gcc/common/config/rs6000/rs6000-common.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/common/config/rs6000/rs6000-common.c b/gcc/common/config/rs6000/rs6000-common.c
index b947196..9dc7ae8 100644
--- a/gcc/common/config/rs6000/rs6000-common.c
+++ b/gcc/common/config/rs6000/rs6000-common.c
@@ -35,7 +35,14 @@ static const struct default_options rs6000_option_optimization_table[] =
{ OPT_LEVELS_ALL, OPT_fsplit_wide_types_early, NULL, 1 },
/* Enable -fsched-pressure for first pass instruction scheduling. */
{ OPT_LEVELS_1_PLUS, OPT_fsched_pressure, NULL, 1 },
- { OPT_LEVELS_2_PLUS, OPT_funroll_loops, NULL, 1 },
+ /* Enable -munroll-only-small-loops with -funroll-loops to unroll small
+ loops at -O2 and above by default. */
+ { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_funroll_loops, NULL, 1 },
+ { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_munroll_only_small_loops, NULL, 1 },
+ /* -fweb and -frename-registers are useless in general for rs6000,
+ turn them off. */
+ { OPT_LEVELS_ALL, OPT_fweb, NULL, 0 },
+ { OPT_LEVELS_ALL, OPT_frename_registers, NULL, 0 },
{ OPT_LEVELS_NONE, 0, NULL, 0 }
};