public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Kewen.Lin" <linkw@linux.ibm.com>
To: Peter Bergner <bergner@linux.ibm.com>,
	Segher Boessenkool <segher@kernel.crashing.org>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	David Edelsohn <dje.gcc@gmail.com>
Subject: Re: [PATCH] rs6000/test: Update some cases with -mdejagnu-tune
Date: Mon, 25 Jul 2022 14:09:06 +0800	[thread overview]
Message-ID: <2cc2ed52-98a2-570e-23ab-c01487b49b13@linux.ibm.com> (raw)
In-Reply-To: <3f076f76-86e5-0033-4d0d-45c6e8f119eb@linux.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 1495 bytes --]

Hi Peter and Segher,

on 2022/7/23 03:28, Peter Bergner wrote:
> On 7/22/22 1:53 PM, Peter Bergner wrote:
>> So I think the way the code above *should* work is:
>>   1) Any -mdejagnu-cpu= usage should filter out all -mcpu= and -mtune= options.
>>   2) Any -mdejagnu-tune= usage should filter all -mtune= options.
>>      It should not filter out any -mcpu= options.
> 
> Like this:
> 
> diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
> index 3b8941a8658..26874943795 100644
> --- a/gcc/config/rs6000/rs6000.h
> +++ b/gcc/config/rs6000/rs6000.h
> @@ -86,7 +86,7 @@
>     RUNTESTFLAGS override those set in the testcases; with this option,
>     the testcase will always win.  Ditto for -mdejagnu-tune=.  */
>  #define DRIVER_SELF_SPECS \
> -  "%{mdejagnu-cpu=*: %<mcpu=* -mcpu=%*}", \
> +  "%{mdejagnu-cpu=*: %<mcpu=* %<mtune=* -mcpu=%*}", \
>    "%{mdejagnu-tune=*: %<mtune=* -mtune=%*}", \
>    "%{mdejagnu-*: %<mdejagnu-*}", \
>     SUBTARGET_DRIVER_SELF_SPECS
> 
> 
> Kewen, can you see if the above patch fixes the issues you're seeing?
> 

Thanks for the insightful comments and patch!

I confirmed that this proposed patch can fix those found test issues.

I adjusted the relevant comments and confirmed that it can be bootstrapped and
regtested on powerpc64-linux-gnu P7 and P8 and powerpc64le-linux-gnu P9 and P10.

Segher pre-approved it, I just committed it as r13-1818 as attached.

Will backport it to release branches in a week or so.  Thanks again.

BR,
Kewen

[-- Attachment #2: 0001-rs6000-Adjust-mdejagnu-cpu-to-filter-out-mtune-PR106.patch --]
[-- Type: text/plain, Size: 2173 bytes --]

From 75d20d6c84c12bedd65a904e462f02f0b9eb3f77 Mon Sep 17 00:00:00 2001
From: Peter Bergner <bergner@linux.ibm.com>
Date: Mon, 25 Jul 2022 00:51:44 -0500
Subject: [PATCH] rs6000: Adjust -mdejagnu-cpu to filter out -mtune [PR106345]

As PR106345 shows, when configuring compiler with an explicit
option --with-tune=<value>, it would cause some test cases to
fail if their test points are sensitive to tune setting, such
as: group_ending_nop, loop align etc.  It doesn't help that
even to specify one explicit -mcpu=.

This patch is to adjust the behavior of -mdejagnu-cpu by
filtering out all -mcpu= and -mtune= options, then test cases
would use <cpu> as tune as the one specified by -mdejagnu-cpu.

2022-07-25  Peter Bergner  <bergner@linux.ibm.com>
	    Kewen Lin  <linkw@linux.ibm.com>

	PR testsuite/106345

gcc/ChangeLog:

	* config/rs6000/rs6000.h (DRIVER_SELF_SPECS): Adjust -mdejagnu-cpu
	to filter out all -mtune options.
---
 gcc/config/rs6000/rs6000.h | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 7d04556304a..ad9bf0f7358 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -81,12 +81,15 @@
 # define SUBTARGET_DRIVER_SELF_SPECS ""
 #endif
 
-/* Only for use in the testsuite: -mdejagnu-cpu= simply overrides -mcpu=.
+/* Only for use in the testsuite: -mdejagnu-cpu=<value> filters out all
+   -mcpu= as well as -mtune= options then simply adds -mcpu=<value>,
+   while -mdejagnu-tune=<value> filters out all -mtune= options then
+   simply adds -mtune=<value>.
    With older versions of Dejagnu the command line arguments you set in
-   RUNTESTFLAGS override those set in the testcases; with this option,
-   the testcase will always win.  Ditto for -mdejagnu-tune=.  */
+   RUNTESTFLAGS override those set in the testcases; with these options,
+   the testcase will always win.  */
 #define DRIVER_SELF_SPECS \
-  "%{mdejagnu-cpu=*: %<mcpu=* -mcpu=%*}", \
+  "%{mdejagnu-cpu=*: %<mcpu=* %<mtune=* -mcpu=%*}", \
   "%{mdejagnu-tune=*: %<mtune=* -mtune=%*}", \
   "%{mdejagnu-*: %<mdejagnu-*}", \
    SUBTARGET_DRIVER_SELF_SPECS
-- 
2.25.1


      reply	other threads:[~2022-07-25  6:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-20  9:31 Kewen.Lin
2022-07-21 18:48 ` Segher Boessenkool
2022-07-22  2:22   ` Kewen.Lin
2022-07-22 18:17     ` Segher Boessenkool
2022-07-22 18:53       ` Peter Bergner
2022-07-22 19:28         ` Peter Bergner
2022-07-25  6:09           ` Kewen.Lin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2cc2ed52-98a2-570e-23ab-c01487b49b13@linux.ibm.com \
    --to=linkw@linux.ibm.com \
    --cc=bergner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).