rs6000/testsuite: Use -mdejagnu-cpu= and -mdejagnu-tune= options
Commit Message
This patch updates the POWER testsuite test cases using -mcpu= and -mtune=
to use the preferred -mdejagnu-cpu= and -mdejagnu-tune= options. This also
obviates the need for the dg-skip-if directive, since the user cannot
override the -mcpu= value being used to compile the test case.
This passed regression testing with no regressions on powerpc64le-linux.
Ok for trunk?
Peter
gcc/testsuite/
* g++.dg/pr65240-1.C: Use -mdejagnu-cpu=. Remove dg-skip-if.
* g++.dg/pr65240-2.C: Likewise.
* g++.dg/pr65240-3.C: Likewise.
* g++.dg/pr65240-4.C: Likewise.
* g++.dg/pr65242.C: Likewise.
* g++.dg/pr67211.C: Likewise.
* g++.dg/pr69667.C: Likewise.
* g++.dg/pr71294.C: Likewise.
* g++.dg/pr84279.C: Likewise.
* g++.dg/torture/ppc-ldst-array.C: Likewise.
* gfortran.dg/nint_p7.f90: Likewise.
* gfortran.dg/pr102860.f90: Likewise.
* gcc.target/powerpc/fusion.c: Use -mdejagnu-cpu= and -mdejagnu-tune=.
* gcc.target/powerpc/fusion2.c: Likewise.
* gcc.target/powerpc/int_128bit-runnable.c: Use -mdejagnu-cpu=.
* gcc.target/powerpc/test_mffsl.c: Likewise.
* gfortran.dg/pr47614.f: Likewise.
* gfortran.dg/pr58968.f: Likewise.
Comments
On Fri, Mar 25, 2022 at 02:51:38PM -0500, Peter Bergner wrote:
> This patch updates the POWER testsuite test cases using -mcpu= and -mtune=
> to use the preferred -mdejagnu-cpu= and -mdejagnu-tune= options. This also
> obviates the need for the dg-skip-if directive, since the user cannot
> override the -mcpu= value being used to compile the test case.
So this is all testcases that say "do not override -mcpu"?
It seems likely many of these tests should move to g++.target/powerpc .
Those that should not should likely not use -mcpu= in the first place
(instead, those tests should use has_arch_pwrN).
> +++ b/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c
> +++ b/gcc/testsuite/gcc.target/powerpc/test_mffsl.c
I missed these two in reviewing when the -mcpu= was introduced, oops.
Okay for trunk. Also okay for backports if you want / if you think it
useful. Thanks!
Segher
On 3/25/22 4:08 PM, Segher Boessenkool wrote:
> On Fri, Mar 25, 2022 at 02:51:38PM -0500, Peter Bergner wrote:
>> This patch updates the POWER testsuite test cases using -mcpu= and -mtune=
>> to use the preferred -mdejagnu-cpu= and -mdejagnu-tune= options. This also
>> obviates the need for the dg-skip-if directive, since the user cannot
>> override the -mcpu= value being used to compile the test case.
>
> So this is all testcases that say "do not override -mcpu"?
Not all of them, but most of them, yes.
> It seems likely many of these tests should move to g++.target/powerpc .
Probably, that can be a follow on patch. Maybe a good first patch for Surya.
> Those that should not should likely not use -mcpu= in the first place
> (instead, those tests should use has_arch_pwrN).
If the test cases explicitly added -mcpu=, I'm guessing they need them
to test whatever the test case is checking for. If we remove the -mcpu=
and reply on dg-require has_arch_pwrN or whatever, then the test case
would only run whenever the default flags match that, right? So it
would seem we'd get less test coverage than before.
>> +++ b/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c
>> +++ b/gcc/testsuite/gcc.target/powerpc/test_mffsl.c
>
> I missed these two in reviewing when the -mcpu= was introduced, oops.
It's WAY too easy to miss those, since -mcpu= is such a common option
that we see and use everyday, we almost expect to see it, so it doesn't
look out of place or wrong.
> Okay for trunk. Also okay for backports if you want / if you think it
> useful. Thanks!
Thanks, commit pushed. I had not thought about backports, but if it
helps stabilize our test results there, it can't hurt. I'll have a
look and see if the tests even exist there or not.
Peter
On Fri, Mar 25, 2022 at 06:15:56PM -0500, Peter Bergner wrote:
> On 3/25/22 4:08 PM, Segher Boessenkool wrote:
> > On Fri, Mar 25, 2022 at 02:51:38PM -0500, Peter Bergner wrote:
> > It seems likely many of these tests should move to g++.target/powerpc .
>
> Probably, that can be a follow on patch. Maybe a good first patch for Surya.
Certainly, it should be a separate patch no matter what; just an
obvious improvement, that your patch exposes :-) It is quite unusual
to see -mcpu= in target-independent testcases: if this particular -mcpu=
(or any other machine flag) exposes the problem, you typically want to
build the testcase everywhere else anyway, for increased coverage :-)
> > Those that should not should likely not use -mcpu= in the first place
> > (instead, those tests should use has_arch_pwrN).
>
> If the test cases explicitly added -mcpu=, I'm guessing they need them
> to test whatever the test case is checking for. If we remove the -mcpu=
> and reply on dg-require has_arch_pwrN or whatever, then the test case
> would only run whenever the default flags match that, right? So it
> would seem we'd get less test coverage than before.
It comes down to what the test wants to test. For target tests -m
options are fine and usual, in most cases you want to test a bug or some
code generation that only happens with those flags; for generic tests,
-m options are unusual.
> >> +++ b/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c
> >> +++ b/gcc/testsuite/gcc.target/powerpc/test_mffsl.c
> >
> > I missed these two in reviewing when the -mcpu= was introduced, oops.
>
> It's WAY too easy to miss those, since -mcpu= is such a common option
> that we see and use everyday, we almost expect to see it, so it doesn't
> look out of place or wrong.
Yes it is very easy. But I trained myself pretty well apparently :-)
> > Okay for trunk. Also okay for backports if you want / if you think it
> > useful. Thanks!
>
> Thanks, commit pushed. I had not thought about backports, but if it
> helps stabilize our test results there, it can't hurt. I'll have a
> look and see if the tests even exist there or not.
It is mostly useful because this causes many more things to be tested.
In the grand scheme of things this is just a few tests, so if it is
hard, just don't bother :-)
Segher
@@ -1,8 +1,7 @@
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
-/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
-/* { dg-options "-mcpu=power8 -O3 -ffast-math -mcmodel=small -mno-fp-in-toc -Wno-return-type" } */
+/* { dg-options "-mdejagnu-cpu=power8 -O3 -ffast-math -mcmodel=small -mno-fp-in-toc -Wno-return-type" } */
/* target/65240, compiler got a 'insn does not satisfy its constraints' error. */
@@ -1,8 +1,7 @@
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
-/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
-/* { dg-options "-mcpu=power8 -O3 -ffast-math -mcmodel=small -mfp-in-toc -Wno-return-type" } */
+/* { dg-options "-mdejagnu-cpu=power8 -O3 -ffast-math -mcmodel=small -mfp-in-toc -Wno-return-type" } */
/* target/65240, compiler got a 'insn does not satisfy its constraints' error. */
@@ -1,8 +1,7 @@
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
-/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
-/* { dg-options "-mcpu=power8 -O3 -ffast-math -mcmodel=medium -Wno-return-type" } */
+/* { dg-options "-mdejagnu-cpu=power8 -O3 -ffast-math -mcmodel=medium -Wno-return-type" } */
/* target/65240, compiler got a 'insn does not satisfy its constraints' error. */
@@ -1,8 +1,7 @@
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
-/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
-/* { dg-options "-mcpu=power7 -O3 -ffast-math -Wno-return-type" } */
+/* { dg-options "-mdejagnu-cpu=power7 -O3 -ffast-math -Wno-return-type" } */
/* target/65240, compiler got a 'insn does not satisfy its constraints' error. */
@@ -1,8 +1,7 @@
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
-/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
-/* { dg-options "-mcpu=power8 -O3" } */
+/* { dg-options "-mdejagnu-cpu=power8 -O3" } */
class A {
public:
@@ -1,8 +1,7 @@
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
-/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
-/* { dg-options "-mcpu=power7 -mtune=power8 -O3 -w" } */
+/* { dg-options "-mdejagnu-cpu=power7 -mdejagnu-tune=power8 -O3 -w" } */
/* target/67211, compiler got a 'insn does not satisfy its constraints' error. */
@@ -1,8 +1,7 @@
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
-/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
-/* { dg-options "-mcpu=power8 -w -std=c++14" } */
+/* { dg-options "-mdejagnu-cpu=power8 -w -std=c++14" } */
/* target/69667, compiler got
internal compiler error: Max. number of generated reload insns per insn is achieved (90) */
@@ -1,7 +1,6 @@
// { dg-do compile { target { powerpc64*-*-* && lp64 } } }
// { dg-require-effective-target powerpc_p8vector_ok } */
-// { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } }
-// { dg-options "-mcpu=power8 -O3 -fstack-protector" }
+// { dg-options "-mdejagnu-cpu=power8 -O3 -fstack-protector" }
// PAR target/71294 failed because RELOAD could not figure how create a V2DI
// vector that auto vectorization created with each element being the same
@@ -2,8 +2,7 @@
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-require-effective-target fpic } */
-/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
-/* { dg-options "-O3 -mcpu=power8 -g -fPIC -fvisibility=hidden -fstack-protector-strong" } */
+/* { dg-options "-O3 -mdejagnu-cpu=power8 -g -fPIC -fvisibility=hidden -fstack-protector-strong" } */
template <typename, typename T> struct E { T e; };
struct J {
@@ -1,6 +1,5 @@
/* { dg-do compile { target { powerpc64*-*-* } } } */
-/* { dg-skip-if "do not override mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
-/* { dg-options "-mcpu=power8" } */
+/* { dg-options "-mdejagnu-cpu=power8" } */
/* When compiled with C++, this code was breaking because of different
tree representations of arrays between C and C++. */
@@ -1,8 +1,7 @@
! Fortran
! { dg-do compile { target { powerpc*-*-* } } }
! { dg-require-effective-target powerpc_vsx_ok }
-! { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } }
-! { dg-options "-O2 -mcpu=power7 -ffast-math" }
+! { dg-options "-O2 -mdejagnu-cpu=power7 -ffast-math" }
! { dg-final { scan-assembler-times "xsrdpi" 2 } }
subroutine test_nint(x4,x8)
@@ -1,8 +1,7 @@
! PR middle-end/102860
! { dg-do compile { target { powerpc*-*-* } } }
! { dg-require-effective-target powerpc_vsx_ok }
-! { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power10" } }
-! { dg-options "-O2 -mcpu=power10" }
+! { dg-options "-O2 -mdejagnu-cpu=power10" }
function foo(a)
integer(kind=4) :: a(1024)
@@ -1,7 +1,7 @@
/* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
-/* { dg-options "-mdejagnu-cpu=power7 -mtune=power8 -O3 -dp" } */
+/* { dg-options "-mdejagnu-cpu=power7 -mdejagnu-tune=power8 -O3 -dp" } */
#define LARGE 0x12345
@@ -2,7 +2,7 @@
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-skip-if "" { powerpc*le-*-* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
-/* { dg-options "-mdejagnu-cpu=power7 -mtune=power8 -O3" } */
+/* { dg-options "-mdejagnu-cpu=power7 -mdejagnu-tune=power8 -O3" } */
vector double fusion_vector (vector double *p) { return p[2]; }
@@ -1,5 +1,5 @@
/* { dg-do run } */
-/* { dg-options "-mcpu=power10 -save-temps" } */
+/* { dg-options "-mdejagnu-cpu=power10 -save-temps" } */
/* { dg-require-effective-target power10_hw } */
/* Check that the expected 128-bit instructions are generated if the processor
@@ -1,5 +1,5 @@
/* { dg-do run { target { powerpc*-*-* } } } */
-/* { dg-options "-O2 -std=c99 -mcpu=power9" } */
+/* { dg-options "-O2 -std=c99 -mdejagnu-cpu=power9" } */
/* { dg-require-effective-target p9vector_hw } */
#ifdef DEBUG
@@ -1,6 +1,6 @@
! { dg-do run { target { powerpc*-*-* } } }
! { dg-skip-if "" { powerpc*-*-darwin* } }
-! { dg-options "-O3 -funroll-loops -ffast-math -mcpu=power4" }
+! { dg-options "-O3 -funroll-loops -ffast-math -mdejagnu-cpu=power4" }
! { dg-options "-O3 -funroll-loops -ffast-math" { target powerpc64le*-*-linux* } }
@@ -1,6 +1,6 @@
C PR rtl-optimization/58968.f
C { dg-do compile { target powerpc*-*-* } }
-C { dg-options "-mcpu=power7 -O3 -w -ffast-math -funroll-loops" }
+C { dg-options "-mdejagnu-cpu=power7 -O3 -w -ffast-math -funroll-loops" }
SUBROUTINE MAKTABS(IW,SOME,LBOX1,LBOX2,LBOX3,NSPACE,NA,NB,
* LBST,X,
* NX,IAMA,IAMI,IBMA,IBMI,MNUM,IDIM,MSTA,IBO,