[PATCH, rs6000] Do not enable pcrel-opt by default

Aaron Sawdey acsawdey@linux.ibm.com
Tue Jun 22 21:13:36 GMT 2021


SPEC2017 testing on p10 shows that this optimization does not have a
positive impact on performance. So we are no longer going to enable it
by default. The test cases for it needed to be updated so they always
enable it to test it.

OK for trunk and backport to 11 if bootstrap/regtest passes?

Thanks!
   Aaron

gcc/

	* config/rs6000/rs6000-cpus.def: Take OPTION_MASK_PCREL_OPT out
	 of OTHER_POWER10_MASKS so it will not be enabled by default.

gcc/testsuite/

	* gcc.target/powerpc/pcrel-opt-inc-di.c: Enable -mpcrel-opt to test it.
	* gcc.target/powerpc/pcrel-opt-ld-df.c: Enable -mpcrel-opt to test it.
	* gcc.target/powerpc/pcrel-opt-ld-di.c: Enable -mpcrel-opt to test it.
	* gcc.target/powerpc/pcrel-opt-ld-hi.c: Enable -mpcrel-opt to test it.
	* gcc.target/powerpc/pcrel-opt-ld-qi.c: Enable -mpcrel-opt to test it.
	* gcc.target/powerpc/pcrel-opt-ld-sf.c: Enable -mpcrel-opt to test it.
	* gcc.target/powerpc/pcrel-opt-ld-si.c: Enable -mpcrel-opt to test it.
	* gcc.target/powerpc/pcrel-opt-ld-vector.c: Enable -mpcrel-opt to
	test it.
	* gcc.target/powerpc/pcrel-opt-st-df.c: Enable -mpcrel-opt to test it.
	* gcc.target/powerpc/pcrel-opt-st-di.c: Enable -mpcrel-opt to test it.
	* gcc.target/powerpc/pcrel-opt-st-hi.c: Enable -mpcrel-opt to test it.
	* gcc.target/powerpc/pcrel-opt-st-qi.c: Enable -mpcrel-opt to test it.
	* gcc.target/powerpc/pcrel-opt-st-sf.c: Enable -mpcrel-opt to test it.
	* gcc.target/powerpc/pcrel-opt-st-si.c: Enable -mpcrel-opt to test it.
	* gcc.target/powerpc/pcrel-opt-st-vector.c: Enable -mpcrel-opt to
	test it.
---
 gcc/config/rs6000/rs6000-cpus.def                      | 3 ++-
 gcc/testsuite/gcc.target/powerpc/pcrel-opt-inc-di.c    | 2 +-
 gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-df.c     | 2 +-
 gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-di.c     | 2 +-
 gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-hi.c     | 2 +-
 gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-qi.c     | 2 +-
 gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-sf.c     | 2 +-
 gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-si.c     | 2 +-
 gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-vector.c | 2 +-
 gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-df.c     | 2 +-
 gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-di.c     | 2 +-
 gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-hi.c     | 2 +-
 gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-qi.c     | 2 +-
 gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-sf.c     | 2 +-
 gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-si.c     | 2 +-
 gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-vector.c | 2 +-
 16 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-cpus.def b/gcc/config/rs6000/rs6000-cpus.def
index 52ce84835f7..1e8c9a68c3f 100644
--- a/gcc/config/rs6000/rs6000-cpus.def
+++ b/gcc/config/rs6000/rs6000-cpus.def
@@ -75,9 +75,10 @@
 				 | OPTION_MASK_P9_VECTOR)
 
 /* Flags that need to be turned off if -mno-power10.  */
+/* PCREL_OPT is now disabled by default so we comment it out here.  */
 #define OTHER_POWER10_MASKS	(OPTION_MASK_MMA			\
 				 | OPTION_MASK_PCREL			\
-				 | OPTION_MASK_PCREL_OPT		\
+				 /* | OPTION_MASK_PCREL_OPT */		\
 				 | OPTION_MASK_PREFIXED)
 
 #define ISA_3_1_MASKS_SERVER	(ISA_3_0_MASKS_SERVER			\
diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-inc-di.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-inc-di.c
index c82041c9dc6..6272f5c72c3 100644
--- a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-inc-di.c
+++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-inc-di.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_pcrel } */
-/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10 -mpcrel-opt" } */
 
 #define TYPE	unsigned int
 
diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-df.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-df.c
index d35862fcb6e..0dcab311add 100644
--- a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-df.c
+++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-df.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_pcrel } */
-/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10 -mpcrel-opt" } */
 
 #define TYPE	double
 #define LARGE	0x20000
diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-di.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-di.c
index 7e1ff99f20e..95b60f3b151 100644
--- a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-di.c
+++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-di.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_pcrel } */
-/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10 -mpcrel-opt" } */
 
 #define TYPE	long long
 #define LARGE	0x20000
diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-hi.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-hi.c
index 4143aeb7371..4a62dfbdf6e 100644
--- a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-hi.c
+++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-hi.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_pcrel } */
-/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10 -mpcrel-opt" } */
 
 #define TYPE	unsigned short
 #define LARGE	0x20000
diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-qi.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-qi.c
index 30d3236f95c..3a7aad45b55 100644
--- a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-qi.c
+++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-qi.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_pcrel } */
-/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10 -mpcrel-opt" } */
 
 #define TYPE	unsigned char
 #define LARGE	0x20000
diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-sf.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-sf.c
index 9d1e2a1956f..cb76bed04b8 100644
--- a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-sf.c
+++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-sf.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_pcrel } */
-/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10 -mpcrel-opt" } */
 
 #define TYPE	float
 #define LARGE	0x20000
diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-si.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-si.c
index 17be6fa1778..ad011d61448 100644
--- a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-si.c
+++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-si.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_pcrel } */
-/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10 -mpcrel-opt" } */
 
 #define TYPE	int
 #define LARGE	0x20000
diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-vector.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-vector.c
index 8c12aea5acd..c8f70b5d433 100644
--- a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-vector.c
+++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-vector.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_pcrel } */
-/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10 -mpcrel-opt" } */
 
 #define TYPE	vector double
 #define LARGE	0x20000
diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-df.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-df.c
index d795d35d8de..686a3761462 100644
--- a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-df.c
+++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-df.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_pcrel } */
-/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10 -mpcrel-opt" } */
 
 #define TYPE	double
 #define LARGE	0x20000
diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-di.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-di.c
index bf57de4b886..fefe6d30e01 100644
--- a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-di.c
+++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-di.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_pcrel } */
-/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10 -mpcrel-opt" } */
 
 #define TYPE	long long
 #define LARGE	0x20000
diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-hi.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-hi.c
index 8822e767dfe..d2856863da7 100644
--- a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-hi.c
+++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-hi.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_pcrel } */
-/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10 -mpcrel-opt" } */
 
 #define TYPE	unsigned short
 #define LARGE	0x20000
diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-qi.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-qi.c
index 2f756833717..f617ffc6adf 100644
--- a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-qi.c
+++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-qi.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_pcrel } */
-/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10 -mpcrel-opt" } */
 
 #define TYPE	unsigned char
 #define LARGE	0x20000
diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-sf.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-sf.c
index 3dd88aad856..6eb20a3e047 100644
--- a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-sf.c
+++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-sf.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_pcrel } */
-/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10 -mpcrel-opt" } */
 
 #define TYPE	float
 #define LARGE	0x20000
diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-si.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-si.c
index 78dc8120efe..0cc0b304dd0 100644
--- a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-si.c
+++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-si.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_pcrel } */
-/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10 -mpcrel-opt" } */
 
 #define TYPE	int
 #define LARGE	0x20000
diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-vector.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-vector.c
index 2c602eb3103..d760819cfd2 100644
--- a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-vector.c
+++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-vector.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target powerpc_pcrel } */
-/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10 -mpcrel-opt" } */
 
 #define TYPE	vector double
 #define LARGE	0x20000
-- 
2.17.1



More information about the Gcc-patches mailing list