aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorguojiufu <guojiufu@linux.ibm.com>2020-04-27 14:08:20 +0800
committerguojiufu <guojiufu@linux.ibm.com>2020-04-27 14:08:20 +0800
commit47c39faa67cc7bd567793b62718ab5e4f931e8d0 (patch)
tree95d6841752c8807dfd73c69fdd2b5f123985aad0
parent66711279083121b07d909ac0fc2f3a744ac7c937 (diff)
downloadgcc-47c39faa67cc7bd567793b62718ab5e4f931e8d0.zip
gcc-47c39faa67cc7bd567793b62718ab5e4f931e8d0.tar.gz
gcc-47c39faa67cc7bd567793b62718ab5e4f931e8d0.tar.bz2
rs6000: enable -fweb for small loops unrolling
Previously -fweb was disabled if only unroll small loops. After that we find there is cases where it could help to rename pseudos and avoid some anti-dependence which may occur after unroll. This patch enables -fweb for small loops unrolling. 2020-04-27 Jiufu Guo <guojiufu@cn.ibm.com> * common/config/rs6000/rs6000-common.c (rs6000_option_optimization_table) [OPT_LEVELS_ALL]: Remove turn off -fweb. * config/rs6000/rs6000.c (rs6000_option_override_internal): Avoid to set flag_web.
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/common/config/rs6000/rs6000-common.c6
-rw-r--r--gcc/config/rs6000/rs6000.c4
3 files changed, 12 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 54cc55c..477d2a7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2020-04-27 Jiufu Guo <guojiufu@cn.ibm.com>
+
+ * common/config/rs6000/rs6000-common.c
+ (rs6000_option_optimization_table) [OPT_LEVELS_ALL]: Remove turn off
+ -fweb.
+ * config/rs6000/rs6000.c (rs6000_option_override_internal): Avoid to
+ set flag_web.
+
2020-04-27 Martin Liska <mliska@suse.cz>
PR lto/94659
diff --git a/gcc/common/config/rs6000/rs6000-common.c b/gcc/common/config/rs6000/rs6000-common.c
index 4f38d56..ee37b9d 100644
--- a/gcc/common/config/rs6000/rs6000-common.c
+++ b/gcc/common/config/rs6000/rs6000-common.c
@@ -38,9 +38,9 @@ static const struct default_options rs6000_option_optimization_table[] =
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 },
+
+ /* -frename-registers leads to non-optimal codegen and performance
+ on rs6000, turn it off by default. */
{ OPT_LEVELS_ALL, OPT_frename_registers, NULL, 0 },
/* Double growth factor to counter reduced min jump length. */
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index aa632ea..2007617 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -4557,7 +4557,7 @@ rs6000_option_override_internal (bool global_init_p)
SCHED_PRESSURE_MODEL);
/* Explicit -funroll-loops turns -munroll-only-small-loops off, and
- turns -fweb and -frename-registers on. */
+ turns -frename-registers on. */
if ((global_options_set.x_flag_unroll_loops && flag_unroll_loops)
|| (global_options_set.x_flag_unroll_all_loops
&& flag_unroll_all_loops))
@@ -4566,8 +4566,6 @@ rs6000_option_override_internal (bool global_init_p)
unroll_only_small_loops = 0;
if (!global_options_set.x_flag_rename_registers)
flag_rename_registers = 1;
- if (!global_options_set.x_flag_web)
- flag_web = 1;
}
/* If using typedef char *va_list, signal that