diff mbox series

[rs6000] enable -fweb for small loops unrolling

Message ID 20200420135731.65650-1-guojiufu@linux.ibm.com
State New
Headers show
Series [rs6000] enable -fweb for small loops unrolling | expand

Commit Message

Jiufu Guo April 20, 2020, 1:57 p.m. UTC
Hi,

Previously -fweb was disabled if only unroll small loops.  After that
we find there is cases where it could help to rename pseudos and aovid
some anti-dependence which may occur after unroll.

Below is a patch to disable -fweb during loop unrolling.

Bootstrap and regtest pass on powerpc, spec2017 run shows no performance
downgrade.

Is this ok for trunk?

BR,
Jiufu

gcc/
2020-04-20  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. 


---
 gcc/common/config/rs6000/rs6000-common.c | 5 ++---
 gcc/config/rs6000/rs6000.c               | 4 +---
 2 files changed, 3 insertions(+), 6 deletions(-)

Comments

Segher Boessenkool April 24, 2020, 9:12 p.m. UTC | #1
Hi!

On Mon, Apr 20, 2020 at 09:57:31PM +0800, guojiufu wrote:
> Previously -fweb was disabled if only unroll small loops.  After that
> we find there is cases where it could help to rename pseudos and aovid
> some anti-dependence which may occur after unroll.
> 
> Below is a patch to disable -fweb during loop unrolling.
> 
> Bootstrap and regtest pass on powerpc, spec2017 run shows no performance
> downgrade.
> 
> Is this ok for trunk?

Yes, this is fine for trunk.  Thank you!

A changelog nit:

> gcc/
> 2020-04-20  Jiufu Guo   <guojiufu@cn.ibm.com>
> 
> 	* common/config/rs6000/rs6000-common.c
> 	(rs6000_option_optimization_table)[OPT_LEVELS_ALL]: Remove turn off
> 	-fweb.

There should be a space before the "[".


Segher
diff mbox series

Patch

diff --git a/gcc/common/config/rs6000/rs6000-common.c b/gcc/common/config/rs6000/rs6000-common.c
index 4f38d566844..87f7fda940a 100644
--- a/gcc/common/config/rs6000/rs6000-common.c
+++ b/gcc/common/config/rs6000/rs6000-common.c
@@ -38,9 +38,8 @@  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 is not very helpful for rs6000, turn it off.  */
     { 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 a2992e682c8..6a9e701bd60 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -4543,7 +4543,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))
@@ -4552,8 +4552,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